sqlj.runtime
Class StreamWrapper
java.lang.Object
|
+--java.io.InputStream
|
+--java.io.FilterInputStream
|
+--sqlj.runtime.StreamWrapper
- Direct Known Subclasses:
- AsciiStream, BinaryStream, UnicodeStream
- public class StreamWrapper
- extends java.io.FilterInputStream
This class wraps a particular InputStream instance. It also extends
the InputStream class by providing direct call-throughs to the wrapped
InputStream for all methods. Additionally, it supports a length
attribute which allows subclasses to be passed as input-parameters
to executable sql operations.
- See Also:
InputStream
Fields inherited from class java.io.FilterInputStream |
in |
Type | Constructor |
protected |
StreamWrapper(java.io.InputStream in)
Creates a new StreamWrapper using the bytes in the passed
InputStream. |
protected |
StreamWrapper(java.io.InputStream in,
int length)
Creates a new StreamWrapper using the bytes in the passed
InputStream. |
Type | Method |
java.io.InputStream |
getInputStream()
Returns the underlying input stream which is being wrapped. |
int |
getLength()
Returns the length in bytes of the wrapped InputStream,
as specified during construction or in the last call to setLength(). |
void |
setLength(int length)
Sets the length attribute of the wrapped stream to be the passed value. |
Methods inherited from class java.io.FilterInputStream |
available,
close,
mark,
markSupported,
read,
read,
read,
reset,
skip |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
StreamWrapper
protected StreamWrapper(java.io.InputStream in)
- Creates a new StreamWrapper using the bytes in the passed
InputStream. The length of the input stream is uninitialized.
- Parameters:
in
- the input stream to wrap
StreamWrapper
protected StreamWrapper(java.io.InputStream in,
int length)
- Creates a new StreamWrapper using the bytes in the passed
InputStream. The length of the input stream is initialized to
the length field passed.
- Parameters:
in
- the input stream to wraplength
- the length of the input stream in bytes
getInputStream
public java.io.InputStream getInputStream()
- Returns the underlying input stream which is being wrapped.
The client is free to get and set this field for reuse
with different input streams, but should also set the
length attribute to match.
getLength
public int getLength()
- Returns the length in bytes of the wrapped InputStream,
as specified during construction or in the last call to setLength().
- Returns:
- the length in bytes of the input stream
setLength
public void setLength(int length)
- Sets the length attribute of the wrapped stream to be the passed value.
This does not effect the wrapped InputStream, but will effect the
number of bytes read from it when it is passed as an input parameter
to an executable sql operation.
- Parameters:
length
- the new length of the InputStream in bytes