|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.io.InputStream
java.io.FilterInputStream
com.karmasphere.share.util.OffsetInputStream
public class OffsetInputStream
A simple InputStream derivative, which keeps track of the current offset.
| Field Summary | |
|---|---|
protected long |
markOffset
Marked offset |
protected long |
offset
Current offset |
| Fields inherited from class java.io.FilterInputStream |
|---|
in |
| Constructor Summary | |
|---|---|
OffsetInputStream(InputStream in)
Create a new OffsetInputStream |
|
OffsetInputStream(InputStream in,
long offset)
Create a new OffsetInputStream with a specified initial offset. |
|
| Method Summary | |
|---|---|
long |
getOffset()
Get the current offset |
void |
mark(int readLimit)
Mark the stream. |
int |
read()
Read a byte from the stream. |
int |
read(byte[] data)
Read from the stream. |
int |
read(byte[] data,
int offset,
int length)
Read from the stream. |
void |
reset()
Reset the stream to the last mark; |
long |
skip(long n)
Skip some bytes. |
| Methods inherited from class java.io.FilterInputStream |
|---|
available, close, markSupported |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected long offset
protected long markOffset
| Constructor Detail |
|---|
public OffsetInputStream(InputStream in)
public OffsetInputStream(InputStream in,
long offset)
| Method Detail |
|---|
public long getOffset()
public int read()
throws IOException
read in class FilterInputStreamIOException
public int read(byte[] data)
throws IOException
read in class FilterInputStreamIOException
public int read(byte[] data,
int offset,
int length)
throws IOException
read in class FilterInputStreamIOExceptionpublic void mark(int readLimit)
mark in class FilterInputStream
public void reset()
throws IOException
reset in class FilterInputStreamIOException
public long skip(long n)
throws IOException
skip in class FilterInputStreamIOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||