Package org.loboevolution.pdfview
Class PDFDocCharsetEncoder
java.lang.Object
java.nio.charset.CharsetEncoder
org.loboevolution.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.
see "PDF Reference version 1.7, Appendix D" Author Luke Kirby
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected CoderResult
encodeLoop
(CharBuffer in, ByteBuffer out) static boolean
isIdentityEncoding
(char ch) Identify whether a particular character preserves the same byte value upon encoding in PDFDocEncodingboolean
isLegalReplacement
(byte[] repl) Methods inherited from class java.nio.charset.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()Constructor for 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:
encodeLoop
in classCharsetEncoder
-
isLegalReplacement
public boolean isLegalReplacement(byte[] repl) - Overrides:
isLegalReplacement
in classCharsetEncoder
-