public class UnsynchronizedByteArrayInputStream extends InputStream
ByteArrayInputStream
which removes the synchronization overhead for non-concurrent
access; as such this class is not thread-safe.| Modifier and Type | Field and Description |
|---|---|
static int |
END_OF_STREAM |
| Constructor and Description |
|---|
UnsynchronizedByteArrayInputStream(byte[] data)
Creates a new byte array input stream.
|
UnsynchronizedByteArrayInputStream(byte[] data,
int offset)
Creates a new byte array input stream.
|
UnsynchronizedByteArrayInputStream(byte[] data,
int offset,
int length)
Creates a new byte array input stream.
|
| Modifier and Type | Method and Description |
|---|---|
int |
available() |
void |
mark(int readlimit) |
boolean |
markSupported() |
int |
read() |
int |
read(byte[] b) |
int |
read(byte[] b,
int off,
int len) |
void |
reset() |
long |
skip(long n) |
closepublic static final int END_OF_STREAM
public UnsynchronizedByteArrayInputStream(byte[] data)
data - the bufferpublic UnsynchronizedByteArrayInputStream(byte[] data, int offset)
data - the bufferoffset - the offset into the bufferIllegalArgumentException - if the offset is less than zeropublic UnsynchronizedByteArrayInputStream(byte[] data, int offset, int length)
data - the bufferoffset - the offset into the bufferlength - the length of the bufferIllegalArgumentException - if the offset or length less than zeropublic int available()
available in class InputStreampublic int read()
read in class InputStreampublic int read(byte[] b)
read in class InputStreampublic int read(byte[] b, int off, int len)
read in class InputStreampublic long skip(long n)
skip in class InputStreampublic boolean markSupported()
markSupported in class InputStreampublic void mark(int readlimit)
mark in class InputStreampublic void reset()
reset in class InputStreamCopyright © 2002–2020 The Apache Software Foundation. All rights reserved.