Class TextBuilder
public class TextBuilder extends ChunkBuilder implements Builder<Chunk>
- Version:
- 1.0 12/31/2012
- Author:
- Wen Yu, yuwen_66@yahoo.com
-
Constructor Summary
Constructors Constructor Description TextBuilder(ChunkType chunkType)
-
Method Summary
Modifier and Type Method 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].
-
Constructor Details
-
Method Details
-
buildData
protected byte[] buildData()- Specified by:
buildData
in classChunkBuilder
-
keyword
The keyword must be at least one character and less than 80 characters long.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.
-
setCompressed
public void setCompressed(boolean compressed) -
text
The tExt chunk is interpreted according to the ISO/IEC 8859-1 (Latin-1) character set [ISO/IEC-8859-1]. The text string can contain any Latin-1 character. Newlines in the text string should be represented by a single line feed character (decimal 10); use of other control characters in the text is discouraged.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
-