Package org.apache.derby.impl.drda
Class ReEncodedInputStream
- java.lang.Object
-
- java.io.InputStream
-
- org.apache.derby.impl.drda.ReEncodedInputStream
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable
public class ReEncodedInputStream extends java.io.InputStreamReEncodedInputStream passes stream from Reader, which is stream of decoded style, to user of this subclass of InputStream, which is stream of encoded style. The encoding of stream passed to user is limited to UTF8. This class will be used to pass stream, which is served as a Reader, as a InputStream of a arbitrary encoding.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static classReEncodedInputStream.PublicBufferOutputStream
-
Field Summary
Fields Modifier and Type Field Description private static intBUFFERED_CHAR_LENprivate char[]decodedBuffer_private java.io.ByteArrayInputStreamencodedInputStream_private ReEncodedInputStream.PublicBufferOutputStreamencodedOutputStream_private java.io.OutputStreamWriterencodedStreamWriter_private java.io.Readerreader_
-
Constructor Summary
Constructors Constructor Description ReEncodedInputStream(java.io.Reader reader)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intavailable()voidclose()protected voidfinalize()intread()private java.io.ByteArrayInputStreamreEncode(java.io.Reader reader)
-
-
-
Field Detail
-
BUFFERED_CHAR_LEN
private static final int BUFFERED_CHAR_LEN
- See Also:
- Constant Field Values
-
reader_
private java.io.Reader reader_
-
decodedBuffer_
private char[] decodedBuffer_
-
encodedStreamWriter_
private java.io.OutputStreamWriter encodedStreamWriter_
-
encodedOutputStream_
private ReEncodedInputStream.PublicBufferOutputStream encodedOutputStream_
-
encodedInputStream_
private java.io.ByteArrayInputStream encodedInputStream_
-
-
Method Detail
-
reEncode
private java.io.ByteArrayInputStream reEncode(java.io.Reader reader) throws java.io.IOException- Throws:
java.io.IOException
-
available
public int available() throws java.io.IOException- Overrides:
availablein classjava.io.InputStream- Throws:
java.io.IOException
-
close
public void close() throws java.io.IOException- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable- Overrides:
closein classjava.io.InputStream- Throws:
java.io.IOException
-
read
public int read() throws java.io.IOException- Specified by:
readin classjava.io.InputStream- Throws:
java.io.IOException
-
finalize
protected void finalize() throws java.io.IOException- Overrides:
finalizein classjava.lang.Object- Throws:
java.io.IOException
-
-