private class RopeByteString.RopeInputStream
extends java.io.InputStream
RopeByteString
equivalent for
ByteArrayInputStream
.Modifier and Type | Field and Description |
---|---|
private ByteString.LeafByteString |
currentPiece |
private int |
currentPieceIndex |
private int |
currentPieceOffsetInRope |
private int |
currentPieceSize |
private int |
mark |
private RopeByteString.PieceIterator |
pieceIterator |
Constructor and Description |
---|
RopeInputStream() |
Modifier and Type | Method and Description |
---|---|
private void |
advanceIfCurrentPieceFullyRead()
Skips to the next piece if we have read all the data in the current
piece.
|
int |
available() |
private void |
initialize()
Common initialization code used by both the constructor and reset()
|
void |
mark(int readAheadLimit) |
boolean |
markSupported() |
int |
read() |
int |
read(byte[] b,
int offset,
int length) |
private int |
readSkipInternal(byte[] b,
int offset,
int length)
Internal implementation of read and skip.
|
void |
reset() |
long |
skip(long length) |
private RopeByteString.PieceIterator pieceIterator
private ByteString.LeafByteString currentPiece
private int currentPieceSize
private int currentPieceIndex
private int currentPieceOffsetInRope
private int mark
public int read(byte[] b, int offset, int length)
read
in class java.io.InputStream
public long skip(long length)
skip
in class java.io.InputStream
private int readSkipInternal(byte[] b, int offset, int length)
length
bytes into the buffer b
at
offset offset
. If b == null, then skip the next length
bytes.
This method assumes that all error checking has already happened.
Returns the actual number of bytes read or skipped.
public int read() throws java.io.IOException
read
in class java.io.InputStream
java.io.IOException
public int available() throws java.io.IOException
available
in class java.io.InputStream
java.io.IOException
public boolean markSupported()
markSupported
in class java.io.InputStream
public void mark(int readAheadLimit)
mark
in class java.io.InputStream
public void reset()
reset
in class java.io.InputStream
private void initialize()
private void advanceIfCurrentPieceFullyRead()