Class PDFDocCharsetEncoder

java.lang.Object
java.nio.charset.CharsetEncoder
com.sun.pdfview.PDFDocCharsetEncoder

public class PDFDocCharsetEncoder extends CharsetEncoder
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:
  • "PDF Reference version 1.7, Appendix D"
  • 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

      protected CoderResult encodeLoop(CharBuffer in, ByteBuffer out)
      Specified by:
      encodeLoop in class CharsetEncoder
    • isLegalReplacement

      public boolean isLegalReplacement(byte[] repl)
      Overrides:
      isLegalReplacement in class CharsetEncoder