|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.io.InputStream
wt.wrmf.transport.RewindableInputStream
This class provides another choice (compared to
ChunkInputStream) to keep (limited) memory of the bytes it has read.
By calling rewindFrom (position), the input stream will be "rewinded"
so that the next byte read will be starting from "position".
Supported API: false
Extendable: false
Field Summary | |
private long |
bytesRead
|
private int |
bytesRewinded
|
private int |
capacity
|
private static String |
CLASSNAME
|
private InputStream |
is
|
private static String |
RESOURCE
|
private byte[] |
rewindableData
|
private byte[] |
tempData
|
private int |
tempIndex
|
private static String |
versionID
|
Fields inherited from class java.io.InputStream |
|
Constructor Summary | |
RewindableInputStream(InputStream is)
Supported API: false |
|
RewindableInputStream(InputStream is,
int memorySize)
Supported API: false |
Method Summary | |
void |
close()
|
long |
getBytesRead()
Get number of bytes being read. |
private void |
initialize()
|
int |
read()
Supported API: false |
int |
read(byte[] buf)
Supported API: false |
int |
read(byte[] buf,
int off,
int len)
Supported API: false |
private int |
read0(byte[] buf,
int off,
int len)
|
void |
rewind()
Try to rewind fully. |
void |
rewindFrom(long position)
Try to rewind the InputStream starting at the position as specified, as if (position -1) bytes have been successfully read only. |
private void |
saveData()
|
long |
skip(long n)
Skip exactly n bytes. |
private void |
tempDataReset()
|
Methods inherited from class java.io.InputStream |
available, mark, markSupported, reset |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private static final String RESOURCE
private static final String CLASSNAME
private InputStream is
private long bytesRead
private int capacity
private byte[] rewindableData
private static final String versionID
private byte[] tempData
private int tempIndex
private int bytesRewinded
Constructor Detail |
public RewindableInputStream(InputStream is, int memorySize)
is
- memorySize
- public RewindableInputStream(InputStream is)
is
- Method Detail |
public int read() throws IOException
IOException
public int read(byte[] buf, int off, int len) throws IOException
buf
- off
- len
-
IOException
public int read(byte[] buf) throws IOException
buf
-
IOException
public long getBytesRead()
public void rewindFrom(long position) throws IOException
position
-
IOException
public void rewind() throws IOException
IOException
public long skip(long n) throws IOException
n
-
IOException
private void initialize()
private void saveData()
private void tempDataReset()
private int read0(byte[] buf, int off, int len) throws IOException
IOException
public void close() throws IOException
IOException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |