public class FastByteArrayInputStream extends InputStream
Constructor and Description |
---|
FastByteArrayInputStream(byte[] buffer)
Ctor.
|
FastByteArrayInputStream(byte[] buffer,
int offset,
int length)
Ctor.
|
Modifier and Type | Method and Description |
---|---|
int |
available() |
byte[] |
getBytes()
Returns the buffer.
|
int |
getLength()
Returns buffer length.
|
int |
getOffset()
Returns buffer offset.
|
void |
mark(int readLimit) |
boolean |
markSupported() |
int |
read() |
int |
read(byte[] toBuf) |
int |
read(byte[] target,
int offset,
int length)
Read bytes to buffer.
|
int |
readFast()
Fast read without sync.
|
int |
readFast(byte[] target)
Read bytes.
|
int |
readFast(byte[] target,
int offset,
int length)
Read bytes.
|
void |
reset() |
void |
setBytes(byte[] bytes)
Sets buffer.
|
void |
setLength(int length)
Set length of buffer.
|
void |
setOffset(int offset)
Sets buffer offset.
|
long |
skip(long count) |
void |
skipFast(int count)
Fast skip.
|
close
public FastByteArrayInputStream(byte[] buffer)
buffer
- to usepublic FastByteArrayInputStream(byte[] buffer, int offset, int length)
buffer
- buffer to useoffset
- offset to start atlength
- length of buffer to usepublic final byte[] getBytes()
public final int getLength()
public final int getOffset()
public void setBytes(byte[] bytes)
bytes
- to setpublic void setLength(int length)
length
- buffer lengthpublic void setOffset(int offset)
offset
- to setpublic int read(byte[] target, int offset, int length) throws IOException
read
in class InputStream
target
- target bufferoffset
- buffer offsetlength
- buffer lengthIOException
- indicates errorpublic int available()
available
in class InputStream
public int read() throws IOException
read
in class InputStream
IOException
public int read(byte[] toBuf) throws IOException
read
in class InputStream
IOException
public void reset()
reset
in class InputStream
public long skip(long count)
skip
in class InputStream
public boolean markSupported()
markSupported
in class InputStream
public void mark(int readLimit)
mark
in class InputStream
public final void skipFast(int count)
count
- bytes to skippublic final int readFast()
public final int readFast(byte[] target)
target
- to fillpublic final int readFast(byte[] target, int offset, int length)
target
- to filloffset
- to filllength
- length to useCopyright © 2005–2021. All rights reserved.