intarsys PDF library API

de.intarsys.pdf.encoding
Class MappedReader

java.lang.Object
  extended by java.io.Reader
      extended by de.intarsys.pdf.encoding.MappedReader
All Implemented Interfaces:
Closeable, Readable

public class MappedReader
extends Reader

A reader that uses a PDF style encoding to map byte code to unicode.


Constructor Summary
MappedReader(InputStream is, Encoding encoding)
          Create a MappedReader
 
Method Summary
 void close()
           
 Encoding getEncoding()
          The encoding used by this reader.
 int read(char[] cbuf, int off, int len)
          Read characters into a portion of an array.
 
Methods inherited from class java.io.Reader
mark, markSupported, read, read, read, ready, reset, skip
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MappedReader

public MappedReader(InputStream is,
                    Encoding encoding)
Create a MappedReader

Parameters:
is - The underlying byte stream.
encoding - The encoding to use.
Method Detail

getEncoding

public Encoding getEncoding()
The encoding used by this reader.

Returns:
The encoding used by this reader.

close

public void close()
           throws IOException
Specified by:
close in interface Closeable
Specified by:
close in class Reader
Throws:
IOException
See Also:
Reader.close()

read

public int read(char[] cbuf,
                int off,
                int len)
         throws IOException
Read characters into a portion of an array. This method will block until some input is available, an I/O error occurs, or the end of the stream is reached.

Specified by:
read in class Reader
Parameters:
cbuf - Destination buffer
off - Offset at which to start storing characters
len - Maximum number of characters to read
Returns:
The number of characters read, or -1 if the end of the stream has been reached
Throws:
IOException - If an I/O error occurs
IndexOutOfBoundsException

intarsys PDF library API

Copyright © 2006 intarsys consulting GmbH. All Rights Reserved.