org.apache.derby.impl.drda
Class ReEncodedInputStream

java.lang.Object
  extended by java.io.InputStream
      extended by org.apache.derby.impl.drda.ReEncodedInputStream
All Implemented Interfaces:
java.io.Closeable

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
private static class ReEncodedInputStream.PublicBufferOutputStream
           
 
Field Summary
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
ReEncodedInputStream(java.io.Reader reader)
           
 
Method Summary
 int available()
           
 void close()
           
protected  void finalize()
           
 int read()
           
private  java.io.ByteArrayInputStream reEncode(java.io.Reader reader)
           
 
Methods inherited from class java.io.InputStream
mark, markSupported, read, read, reset, skip
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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_
Constructor Detail

ReEncodedInputStream

public ReEncodedInputStream(java.io.Reader reader)
                     throws java.io.IOException
Throws:
java.io.IOException
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 class java.io.InputStream
Throws:
java.io.IOException

close

public void close()
           throws java.io.IOException
Specified by:
close in interface java.io.Closeable
Overrides:
close in class java.io.InputStream
Throws:
java.io.IOException

read

public int read()
         throws java.io.IOException
Specified by:
read in class java.io.InputStream
Throws:
java.io.IOException

finalize

protected void finalize()
                 throws java.io.IOException
Overrides:
finalize in class java.lang.Object
Throws:
java.io.IOException

Built on Thu 2012-03-29 21:53:33+0000, from revision ???

Apache Derby V10.6 Internals - Copyright © 2004,2007 The Apache Software Foundation. All Rights Reserved.