Closeable, AutoCloseable, Comparable<PositionInputStream>TestInputStreampublic class PositionInputStream extends DelegatingInputStream implements Comparable<PositionInputStream>
| Constructor | Description |
|---|---|
PositionInputStream(InputStream inputStream) |
|
PositionInputStream(InputStream inputStream,
long positionOffset) |
| Modifier and Type | Method | Description |
|---|---|---|
int |
compareTo(PositionInputStream o) |
|
boolean |
equals(Object obj) |
|
long |
getPosition() |
|
int |
hashCode() |
|
int |
read() |
|
int |
read(byte[] b) |
|
int |
read(byte[] b,
int off,
int len) |
|
long |
seek(long position) |
|
long |
skip(long n) |
This method overrides the
InputStream.skip(long) method to extend the
contract of the method:
This method tries to skip n bytes until the end of the stream or until an
exception is thrown. |
available, close, mark, markSupported, reset, toStringreadAllBytes, readNBytes, transferTopublic PositionInputStream(InputStream inputStream)
public PositionInputStream(InputStream inputStream, long positionOffset)
public int read()
throws IOException
read in class DelegatingInputStreamIOExceptionpublic int read(byte[] b)
throws IOException
read in class DelegatingInputStreamIOExceptionpublic int read(byte[] b,
int off,
int len)
throws IOException
read in class DelegatingInputStreamIOExceptionpublic final long getPosition()
public final long seek(long position)
throws IOException
IOExceptionpublic long skip(long n)
throws IOException
DelegatingInputStreamInputStream.skip(long) method to extend the
contract of the method:
BufferedInputStream only skip a certain amount of bytes (in this
case until the end of the current buffer) with the first call. Subsequent
calls skip more bytes later on. This is fixed here.skip in class DelegatingInputStreamn - is the number bytes to skip.IOExceptionpublic int compareTo(PositionInputStream o)
compareTo in interface Comparable<PositionInputStream>Copyright © 2017–2018 PureSol Technologies. All rights reserved.