public interface MeasurableStream
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).
| Modifier and Type | Method and Description |
|---|---|
long |
length()
Returns the overall length of this stream (optional operation).
|
long |
position()
Returns the current position in this stream (optional operation).
|
long length()
throws java.io.IOException
java.io.IOExceptionlong 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