| Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
| StringSizeTerminated |
|
| 1.5;1.5 |
| 1 | /** | |
| 2 | * @author : Paul Taylor | |
| 3 | * @author : Eric Farng | |
| 4 | * | |
| 5 | * Version @version:$Id: StringSizeTerminated.java,v 1.9 2008/01/01 15:12:56 paultaylor Exp $ | |
| 6 | * | |
| 7 | * MusicTag Copyright (C)2003,2004 | |
| 8 | * | |
| 9 | * This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser | |
| 10 | * General Public License as published by the Free Software Foundation; either version 2.1 of the License, | |
| 11 | * or (at your option) any later version. | |
| 12 | * | |
| 13 | * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even | |
| 14 | * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | |
| 15 | * See the GNU Lesser General Public License for more details. | |
| 16 | * | |
| 17 | * You should have received a copy of the GNU Lesser General Public License along with this library; if not, | |
| 18 | * you can get a copy from http://www.opensource.org/licenses/lgpl-license.php or write to the Free Software | |
| 19 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
| 20 | * | |
| 21 | * Description: | |
| 22 | * Contains a string which is NOT null terminated. | |
| 23 | * Warning this datatype type can only be used as the last datatype in a frame because | |
| 24 | * it reads the remainder of the frame as there is no null terminated or provision | |
| 25 | * for setting a defined size. | |
| 26 | * | |
| 27 | */ | |
| 28 | package org.jaudiotagger.tag.datatype; | |
| 29 | ||
| 30 | import org.jaudiotagger.tag.id3.AbstractTagFrameBody; | |
| 31 | import org.jaudiotagger.tag.id3.valuepair.TextEncoding; | |
| 32 | ||
| 33 | /** | |
| 34 | * Represents a String which is not delimited by null character with fixed text encoding. | |
| 35 | * <p/> | |
| 36 | * This type of String will usually only be used when it is the last field within a frame, when reading the remainder of the byte array will | |
| 37 | * be read, when writing the frame will accomodate the required size for the String. The String will be encoded | |
| 38 | * using the default encoding regardless of what encoding may be specified in the framebody | |
| 39 | */ | |
| 40 | public class StringSizeTerminated extends TextEncodedStringSizeTerminated | |
| 41 | { | |
| 42 | ||
| 43 | /** | |
| 44 | * Creates a new ObjectStringSizeTerminated datatype. | |
| 45 | * | |
| 46 | * @param identifier identifies the frame type | |
| 47 | */ | |
| 48 | public StringSizeTerminated(String identifier, AbstractTagFrameBody frameBody) | |
| 49 | { | |
| 50 | 113 | super(identifier, frameBody); |
| 51 | 113 | } |
| 52 | ||
| 53 | public StringSizeTerminated(StringSizeTerminated object) | |
| 54 | { | |
| 55 | 42 | super(object); |
| 56 | 42 | } |
| 57 | ||
| 58 | public boolean equals(Object obj) | |
| 59 | { | |
| 60 | 0 | if (obj instanceof StringSizeTerminated == false) |
| 61 | { | |
| 62 | 0 | return false; |
| 63 | } | |
| 64 | 0 | return super.equals(obj); |
| 65 | } | |
| 66 | ||
| 67 | protected String getTextEncodingCharSet() | |
| 68 | { | |
| 69 | 91 | return TextEncoding.CHARSET_ISO_8859_1; |
| 70 | } | |
| 71 | } |