sqlj.runtime

Class StreamWrapper

java.lang.Object
  extended by java.io.InputStream
      extended by java.io.FilterInputStream
          extended by sqlj.runtime.StreamWrapper
All Implemented Interfaces:
Closeable
Direct Known Subclasses:
AsciiStream, BinaryStream, UnicodeStream

public abstract 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

Field Summary
 
Fields inherited from class java.io.FilterInputStream
in
 
Constructor Summary
protected StreamWrapper(InputStream in)
          Creates a new StreamWrapper using the bytes in the passed InputStream.
protected StreamWrapper(InputStream in, int length)
          Creates a new StreamWrapper using the bytes in the passed InputStream.
 
Method Summary
 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
 

Constructor Detail

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
Method Detail

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
Access Rights

This class can be accessed from:


SC DC Public Part ACH
[sap.com] CORE-TOOLS [sap.com] com.sap.engine.client.libdeprecated default BC-JAS
[sap.com] ENGINEAPI [sap.com] opensqldeprecated default BC-JAS-PER-SQL
[sap.com] ENGFACADE [sap.com] tc/je/opensql/api api BC-JAS


Copyright 2012 SAP AG Complete Copyright Notice