|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface MeasurableStream
An stream that provides eager access to its length, and keeps track of the current position (e.g., the number of bytes read so far, or the current position of the file pointer).
This class has two methods, both specified as optional. This apparently bizarre
behaviour is necessary because of wrapper classes which use reflection
to support those methods (see, e.g., MeasurableInputStream
, FastBufferedInputStream
and FastBufferedOutputStream
).
Method Summary | |
---|---|
long |
length()
Returns the overall length of this stream (optional operation). |
long |
position()
Returns the current position in this stream (optional operation). |
Method Detail |
---|
long length() throws java.io.IOException
java.io.IOException
long position() throws java.io.IOException
Usually, the position is just the number of bytes read or written
since the stream was opened, but in the case of a
RepositionableStream
it
represent the current position.
java.io.IOException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |