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.InputStream
ReEncodedInputStream 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 class
ReEncodedInputStream.PublicBufferOutputStream
-
Field Summary
Fields Modifier and Type Field Description private static int
BUFFERED_CHAR_LEN
private char[]
decodedBuffer_
private java.io.ByteArrayInputStream
encodedInputStream_
private ReEncodedInputStream.PublicBufferOutputStream
encodedOutputStream_
private java.io.OutputStreamWriter
encodedStreamWriter_
private java.io.Reader
reader_
-
Constructor Summary
Constructors Constructor Description ReEncodedInputStream(java.io.Reader reader)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
available()
void
close()
protected void
finalize()
int
read()
private java.io.ByteArrayInputStream
reEncode(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:
available
in classjava.io.InputStream
- Throws:
java.io.IOException
-
close
public void close() throws java.io.IOException
- Specified by:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfacejava.io.Closeable
- Overrides:
close
in classjava.io.InputStream
- Throws:
java.io.IOException
-
read
public int read() throws java.io.IOException
- Specified by:
read
in classjava.io.InputStream
- Throws:
java.io.IOException
-
finalize
protected void finalize() throws java.io.IOException
- Overrides:
finalize
in classjava.lang.Object
- Throws:
java.io.IOException
-
-