    All Packages    This Package  Previous  Next

# Class sqlj.runtime.StreamWrapper

    java.lang.Object
       |
       +----java.io.InputStream
               |
               +----java.io.FilterInputStream
                       |
                       +----sqlj.runtime.StreamWrapper

public class StreamWrapper
extends 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

##

StreamWrapper(InputStream)
  Creates a new StreamWrapper using the bytes in the passed InputStream.
StreamWrapper(InputStream, int)
  Creates a new StreamWrapper using the bytes in the passed InputStream.

##

getInputStream()
  Returns the underlying input stream which is being wrapped.
getLength()
  Returns the length in bytes of the wrapped InputStream, as specified during construction or in the last call to setLength().
setLength(int)
  Sets the length attribute of the wrapped stream to be the passed value.

##

StreamWrapper

     protected StreamWrapper(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(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 wrap
    length - the length of the input stream in bytes

##

getInputStream

     public 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

    All Packages    This Package  Previous  Next