org.apache.batik.util.io
Class GenericDecoder

java.lang.Object
  extended by org.apache.batik.util.io.GenericDecoder
All Implemented Interfaces:
CharDecoder

public class GenericDecoder
extends Object
implements CharDecoder

This class delegates to a reader the decoding of an input stream.


Field Summary
protected  Reader reader
          The reader used to decode the stream.
 
Fields inherited from interface org.apache.batik.util.io.CharDecoder
END_OF_STREAM
 
Constructor Summary
GenericDecoder(InputStream is, String enc)
          Creates a new GenericDecoder.
GenericDecoder(Reader r)
          Creates a new GenericDecoder.
 
Method Summary
 void dispose()
          Disposes the associated resources.
 int readChar()
          Reads the next character.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

reader

protected Reader reader
The reader used to decode the stream.

Constructor Detail

GenericDecoder

public GenericDecoder(InputStream is,
                      String enc)
               throws IOException
Creates a new GenericDecoder.

Parameters:
is - The input stream to decode.
enc - The Java encoding name.
Throws:
IOException

GenericDecoder

public GenericDecoder(Reader r)
Creates a new GenericDecoder.

Parameters:
r - The reader to use.
Method Detail

readChar

public int readChar()
             throws IOException
Reads the next character.

Specified by:
readChar in interface CharDecoder
Returns:
a character or END_OF_STREAM.
Throws:
IOException

dispose

public void dispose()
             throws IOException
Disposes the associated resources.

Specified by:
dispose in interface CharDecoder
Throws:
IOException


Copyright © 2008 Apache Software Foundation. All Rights Reserved.