Class PDFDocCharsetEncoder
java.lang.Object
java.nio.charset.CharsetEncoder
com.sun.pdfview.PDFDocCharsetEncoder
Encodes into a PDFDocEncoding representation. Note that only 256 characters
(if that) are represented in the PDFDocEncoding, so users should be
prepared to deal with unmappable character exceptions.
- Author:
- Luke Kirby
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected CoderResultencodeLoop(CharBuffer in, ByteBuffer out) static booleanisIdentityEncoding(char ch) Identify whether a particular character preserves the same byte value upon encoding in PDFDocEncodingbooleanisLegalReplacement(byte[] repl) Methods inherited from class CharsetEncoder
averageBytesPerChar, canEncode, canEncode, charset, encode, encode, flush, implFlush, implOnMalformedInput, implOnUnmappableCharacter, implReplaceWith, implReset, malformedInputAction, maxBytesPerChar, onMalformedInput, onUnmappableCharacter, replacement, replaceWith, reset, unmappableCharacterAction
-
Constructor Details
-
PDFDocCharsetEncoder
public PDFDocCharsetEncoder()
-
-
Method Details
-
isIdentityEncoding
public static boolean isIdentityEncoding(char ch) Identify whether a particular character preserves the same byte value upon encoding in PDFDocEncoding- Parameters:
ch- the character- Returns:
- whether the character is identity encoded
-
encodeLoop
- Specified by:
encodeLoopin classCharsetEncoder
-
isLegalReplacement
public boolean isLegalReplacement(byte[] repl) - Overrides:
isLegalReplacementin classCharsetEncoder
-