Top Description Methods
org.apache.derby.iapi.types

public Interface PositionedStream

Known Direct Implementers
org.apache.derby.impl.jdbc.LOBInputStream, org.apache.derby.impl.jdbc.PositionedStoreStream
Imports
java.io.IOException, .InputStream, org.apache.derby.shared.common.error.StandardException

This interface describes a stream that is aware of its own position and can reposition itself on request.

This interface doesn't convey any information about how expensive it is for the stream to reposition itself.

Method Summary

Modifier and TypeMethod and Description
public InputStream

Returns:

An InputStream reference to self.
asInputStream
()

Returns a reference to self as an InputStream.

public long

Returns:

Current byte position of the stream.
getPosition
()

Returns the current byte position of the stream.

public void
reposition(long
requested byte position, first position is 0
requestedPos
)

Repositions the stream to the requested byte position.

Method Detail

asInputStreamback to summary
public InputStream asInputStream()

Returns a reference to self as an InputStream.

This method is not allowed to return null.

Returns:InputStream

An InputStream reference to self.

getPositionback to summary
public long getPosition()

Returns the current byte position of the stream.

Returns:long

Current byte position of the stream.

repositionback to summary
public void reposition(long requestedPos) throws IOException, StandardException

Repositions the stream to the requested byte position.

If the repositioning fails because the stream is exhausted, most likely because of an invalid position specified by the user, the stream is reset to position zero and an EOFException is thrown.

Parameters
requestedPos:long

requested byte position, first position is 0

Exceptions
IOException:
if accessing the stream fails
StandardException:
if an error occurs in store
EOFException:
if the requested position is equal to or larger than the length of the stream