com.sun.pdfview
Class PDFDocCharsetEncoder

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

public class PDFDocCharsetEncoder
extends java.nio.charset.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.

See Also:
"PDF Reference version 1.7, Appendix D"

Constructor Summary
PDFDocCharsetEncoder()
           
 
Method Summary
protected  java.nio.charset.CoderResult encodeLoop(java.nio.CharBuffer in, java.nio.ByteBuffer out)
           
static boolean isIdentityEncoding(char ch)
          Identify whether a particular character preserves the same byte value upon encoding in PDFDocEncoding
 boolean 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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PDFDocCharsetEncoder

public PDFDocCharsetEncoder()
Method Detail

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 java.nio.charset.CoderResult encodeLoop(java.nio.CharBuffer in,
                                                  java.nio.ByteBuffer out)
Specified by:
encodeLoop in class java.nio.charset.CharsetEncoder

isLegalReplacement

public boolean isLegalReplacement(byte[] repl)
Overrides:
isLegalReplacement in class java.nio.charset.CharsetEncoder