java.lang.Object
com.sixlegs.image.png.Chunk
com.sixlegs.image.png.KeyValueChunk
com.sixlegs.image.png.AbstractTextChunk
- All Implemented Interfaces:
- java.lang.Cloneable, TextChunk
- Direct Known Subclasses:
- Chunk_iTXt, Chunk_tEXt, Chunk_zTXt
- abstract class AbstractTextChunk
- extends KeyValueChunk
- implements TextChunk
special_keys
private static java.util.Hashtable special_keys
key
protected java.lang.String key
value
protected java.lang.String value
length
int length
type
int type
img
protected PngImage img
in_data
protected ExDataInputStream in_data
IHDR
static final int IHDR
- See Also:
- Constant Field Values
PLTE
static final int PLTE
- See Also:
- Constant Field Values
IDAT
static final int IDAT
- See Also:
- Constant Field Values
IEND
static final int IEND
- See Also:
- Constant Field Values
bKGD
static final int bKGD
- See Also:
- Constant Field Values
cHRM
static final int cHRM
- See Also:
- Constant Field Values
gAMA
static final int gAMA
- See Also:
- Constant Field Values
hIST
static final int hIST
- See Also:
- Constant Field Values
pHYs
static final int pHYs
- See Also:
- Constant Field Values
sBIT
static final int sBIT
- See Also:
- Constant Field Values
tEXt
static final int tEXt
- See Also:
- Constant Field Values
tIME
static final int tIME
- See Also:
- Constant Field Values
tRNS
static final int tRNS
- See Also:
- Constant Field Values
zTXt
static final int zTXt
- See Also:
- Constant Field Values
sRGB
static final int sRGB
- See Also:
- Constant Field Values
sPLT
static final int sPLT
- See Also:
- Constant Field Values
oFFs
static final int oFFs
- See Also:
- Constant Field Values
sCAL
static final int sCAL
- See Also:
- Constant Field Values
iCCP
static final int iCCP
- See Also:
- Constant Field Values
pCAL
static final int pCAL
- See Also:
- Constant Field Values
iTXt
static final int iTXt
- See Also:
- Constant Field Values
gIFg
static final int gIFg
- See Also:
- Constant Field Values
gIFx
static final int gIFx
- See Also:
- Constant Field Values
AbstractTextChunk
AbstractTextChunk(int type)
toString
public java.lang.String toString()
- Description copied from class:
java.lang.Object
- Convert this Object to a human-readable String.
There are no limits placed on how long this String
should be or what it should contain. We suggest you
make it as intuitive as possible to be able to place
it into System.out.println() 55
and such.
It is typical, but not required, to ensure that this method
never completes abruptly with a java.lang.RuntimeException.
This method will be called when performing string
concatenation with this object. If the result is
null, string concatenation will instead
use "null".
The default implementation returns
getClass().getName() + "@" +
Integer.toHexString(hashCode()).
getKeyword
public java.lang.String getKeyword()
- Description copied from interface:
TextChunk
- Returns the Latin-1 [ISO-8859-1] encoded keyword
of this TextChunk.
- Specified by:
getKeyword in interface TextChunk
getText
public java.lang.String getText()
- Description copied from interface:
TextChunk
- Returns the text of this TextChunk.
- Specified by:
getText in interface TextChunk
getTranslatedKeyword
public abstract java.lang.String getTranslatedKeyword()
- Description copied from interface:
TextChunk
- Returns a translation of the keyword into the language
used by this TextChunk, or null if unspecified.
- Specified by:
getTranslatedKeyword in interface TextChunk
getLanguage
public abstract java.lang.String getLanguage()
- Description copied from interface:
TextChunk
- Returns the language [RFC-1766] used by the translated
keyword and the text, or null if unspecified.
- Specified by:
getLanguage in interface TextChunk
readKey
protected java.lang.String readKey()
throws java.io.IOException
- Overrides:
readKey in class KeyValueChunk
readValue
protected java.lang.String readValue()
throws java.io.IOException
- Overrides:
readValue in class KeyValueChunk
repairValue
private static java.lang.String repairValue(java.lang.String val)
getChunkType
public java.lang.String getChunkType()
- Description copied from interface:
TextChunk
- Returns the original chunk type of this TextChunk: "tEXt",
"zTXt", or "iTXt".
- Specified by:
getChunkType in interface TextChunk
isCompressed
protected abstract boolean isCompressed()
getEncoding
protected java.lang.String getEncoding()
readData
protected void readData()
throws java.io.IOException
- Overrides:
readData in class Chunk
repairKey
static java.lang.String repairKey(java.lang.String k)
copy
Chunk copy()
isAncillary
boolean isAncillary()
isPrivate
final boolean isPrivate()
isReservedSet
final boolean isReservedSet()
isSafeToCopy
final boolean isSafeToCopy()
isUnknown
final boolean isUnknown()
bytesRemaining
int bytesRemaining()
multipleOK
protected boolean multipleOK()
beforeIDAT
protected boolean beforeIDAT()
typeToString
static java.lang.String typeToString(int x)
stringToType
static int stringToType(java.lang.String id)
badLength
final void badLength(int correct)
throws PngException
badLength
final void badLength()
throws PngException