| org.apache.derby.iapi.services.io.LimitInputStream org.apache.derby.iapi.types.RawToBinaryFormatStream
RawToBinaryFormatStream | final public class RawToBinaryFormatStream extends LimitInputStream (Code) | | Stream that takes a raw input stream and converts it
to the on-disk format of the binary types by prepending the
length of the value.
If the length of the stream is known then it is encoded
as the first bytes in the stream in the defined format.
If the length is unknown then the first four bytes will
be zero, indicating unknown length.
Note: This stream cannot be re-used. Once end of file is
reached, the next read call will throw an EOFException
See Also: SQLBinary |
Constructor Summary | |
public | RawToBinaryFormatStream(InputStream in, int length) Create a binary on-disk stream from the given InputStream . | public | RawToBinaryFormatStream(InputStream in, int maximumLength, String typeName) Create a binary on-disk stream from the given InputStream
of unknown length.
A limit is placed on the maximum length of the stream.
Parameters: in - the application stream Parameters: maximumLength - maximum length of the column data is inserted into Parameters: typeName - type name for the column data is inserted into throws: IllegalArgumentException - if maximum length is negative, or typename is null. |
Method Summary | |
public int | read() Read from the wrapped stream prepending the intial bytes if needed. | public int | read(byte b, int off, int len) Read from the wrapped stream prepending the intial bytes if needed. |
RawToBinaryFormatStream | public RawToBinaryFormatStream(InputStream in, int length)(Code) | | Create a binary on-disk stream from the given InputStream .
The on-disk stream prepends a length encoding, and validates that the
actual length of the stream matches the specified length (as according
to JDBC 3.0).
Parameters: in - application's raw binary stream passed into JDBC layer Parameters: length - length of the stream throws: IllegalArgumentException - if length is negative.This exception should never be exposed to the user, and seeing itmeans a programming error exists in the code. |
RawToBinaryFormatStream | public RawToBinaryFormatStream(InputStream in, int maximumLength, String typeName)(Code) | | Create a binary on-disk stream from the given InputStream
of unknown length.
A limit is placed on the maximum length of the stream.
Parameters: in - the application stream Parameters: maximumLength - maximum length of the column data is inserted into Parameters: typeName - type name for the column data is inserted into throws: IllegalArgumentException - if maximum length is negative, or typename is null. This exception should never be exposedto the user, and seeing it means a programming error exists in thecode. Although a missing type name is not critical, an exception isis thrown to signal the intended use of this constructor. |
read | public int read() throws IOException(Code) | | Read from the wrapped stream prepending the intial bytes if needed.
If stream has been read, and eof reached, in that case any subsequent
read will throw an EOFException
|
read | public int read(byte b, int off, int len) throws IOException(Code) | | Read from the wrapped stream prepending the intial bytes if needed.
If stream has been read, and eof reached, in that case any subsequent
read will throw an EOFException
|
Fields inherited from org.apache.derby.iapi.services.io.LimitInputStream | protected boolean limitInPlace(Code)(Java Doc) protected int remainingBytes(Code)(Java Doc)
|
|
|