org.apache.derby.impl.jdbc
Class RawToBinaryFormatStream

java.lang.Object
  extended byjava.io.InputStream
      extended byjava.io.FilterInputStream
          extended byorg.apache.derby.iapi.services.io.LimitInputStream
              extended byorg.apache.derby.impl.jdbc.RawToBinaryFormatStream
All Implemented Interfaces:
Limit

class RawToBinaryFormatStream
extends LimitInputStream

Stream that takes a raw input stream and converts it to the format of the binary types by prepending the length of the value. In this case 0 is always written.


Field Summary
private  int dummyBytes
           
 
Fields inherited from class org.apache.derby.iapi.services.io.LimitInputStream
limitInPlace, remainingBytes
 
Fields inherited from class java.io.FilterInputStream
in
 
Fields inherited from class java.io.InputStream
 
Constructor Summary
(package private) RawToBinaryFormatStream(java.io.InputStream in, int length)
           
 
Method Summary
private  void checkSufficientData()
          JDBC 3.0 (from tutorial book) requires that an input stream has the correct number of bytes in the stream.
 int read()
          Read from the wrapped stream prepending the intial bytes if needed.
 int read(byte[] b, int off, int len)
          Read from the wrapped stream prepending the intial bytes if needed.
 
Methods inherited from class org.apache.derby.iapi.services.io.LimitInputStream
available, clearLimit, setInput, setLimit, skip
 
Methods inherited from class java.io.FilterInputStream
close, mark, markSupported, read, reset
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

dummyBytes

private int dummyBytes
Constructor Detail

RawToBinaryFormatStream

RawToBinaryFormatStream(java.io.InputStream in,
                        int length)
Parameters:
in - Application's raw binary stream passed into JDBC layer
length - - length of the stream, if known, otherwise -1.
Method Detail

read

public int read()
         throws java.io.IOException
Read from the wrapped stream prepending the intial bytes if needed.

Overrides:
read in class LimitInputStream
Throws:
java.io.IOException

checkSufficientData

private void checkSufficientData()
                          throws java.io.IOException
JDBC 3.0 (from tutorial book) requires that an input stream has the correct number of bytes in the stream.

Throws:
java.io.IOException

read

public int read(byte[] b,
                int off,
                int len)
         throws java.io.IOException
Read from the wrapped stream prepending the intial bytes if needed.

Overrides:
read in class LimitInputStream
Throws:
java.io.IOException


Apache Derby V10.0 Engine Documentation - Copyright © 1997,2004 The Apache Software Foundation or its licensors, as applicable.