Package org.apache.derby.iapi.types
Interface PositionedStream
-
- All Known Implementing Classes:
LOBInputStream
,PositionedStoreStream
public interface PositionedStream
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
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.io.InputStream
asInputStream()
Returns a reference to self as anInputStream
.long
getPosition()
Returns the current byte position of the stream.void
reposition(long requestedPos)
Repositions the stream to the requested byte position.
-
-
-
Method Detail
-
asInputStream
java.io.InputStream asInputStream()
Returns a reference to self as anInputStream
.This method is not allowed to return
null
.- Returns:
- An
InputStream
reference to self.
-
getPosition
long getPosition()
Returns the current byte position of the stream.- Returns:
- Current byte position of the stream.
-
reposition
void reposition(long requestedPos) throws java.io.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
- requested byte position, first position is0
- Throws:
java.io.IOException
- if accessing the stream failsjava.io.EOFException
- if the requested position is equal to or larger than the length of the streamStandardException
- if an error occurs in store
-
-