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.InputStreampublic long skip(long length)
skip in class java.io.InputStreamprivate 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.InputStreamjava.io.IOExceptionpublic int available()
throws java.io.IOException
available in class java.io.InputStreamjava.io.IOExceptionpublic boolean markSupported()
markSupported in class java.io.InputStreampublic void mark(int readAheadLimit)
mark in class java.io.InputStreampublic void reset()
reset in class java.io.InputStreamprivate void initialize()
private void advanceIfCurrentPieceFullyRead()