public class TextBuilder extends ChunkBuilder implements Builder<Chunk>
Constructor and Description |
---|
TextBuilder(ChunkType chunkType) |
Modifier and Type | Method and Description |
---|---|
protected byte[] |
buildData() |
TextBuilder |
keyword(java.lang.String keyword)
The keyword must be at least one character and less than 80 characters long.
|
void |
setCompressed(boolean compressed) |
TextBuilder |
text(java.lang.String text)
The tExt chunk is interpreted according to the ISO/IEC 8859-1 (Latin-1) character
set [ISO/IEC-8859-1].
|
build, getChunkType
public TextBuilder(ChunkType chunkType)
protected byte[] buildData()
buildData
in class ChunkBuilder
public TextBuilder keyword(java.lang.String keyword)
Keywords are always interpreted according to the ISO/IEC 8859-1 (Latin-1) character set [ISO/IEC-8859-1].
They must contain only printable Latin-1 characters and spaces; that is, only character codes 32-126 and 161-255 decimal are allowed.
To reduce the chances for human misreading of a keyword, leading and trailing spaces are forbidden, as are consecutive spaces.
Note also that the non-breaking space (code 160) is not permitted in keywords, since it is visually indistinguishable from an ordinary space.
public void setCompressed(boolean compressed)
public TextBuilder text(java.lang.String text)
The zTXt chunk contains textual data, just as tEXt does; however, zTXt takes advantage of compression. The zTXt and tEXt chunks are semantically equivalent, but zTXt is recommended for storing large blocks of text. A zTXt chunk contains: Keyword: 1-79 bytes (character string) Null separator: 1 byte Compression method: 1 byte Compressed text: n bytes
iTXt International textual data This chunk is semantically equivalent to the tEXt and zTXt chunks, but the textual data is in the UTF-8 encoding of the Unicode character set instead of Latin-1. This chunk contains: Keyword: 1-79 bytes (character string) Null separator: 1 byte Compression flag: 1 byte Compression method: 1 byte Language tag: 0 or more bytes (character string) Null separator: 1 byte Translated keyword: 0 or more bytes Null separator: 1 byte Text: 0 or more bytes