public class UnsynchronizedByteArrayInputStream extends InputStream
ByteArrayInputStream which removes the synchronization overhead for non-concurrent access; as such this class is
not thread-safe.
To build an instance, see UnsynchronizedByteArrayInputStream.Builder.
ByteArrayInputStream| Modifier and Type | Class and Description |
|---|---|
static class |
UnsynchronizedByteArrayInputStream.Builder
Builds a new
UnsynchronizedByteArrayInputStream instance. |
| Modifier and Type | Field and Description |
|---|---|
static int |
END_OF_STREAM
The end of stream marker.
|
| Constructor and Description |
|---|
UnsynchronizedByteArrayInputStream(byte[] data)
Deprecated.
|
UnsynchronizedByteArrayInputStream(byte[] data,
int offset)
Deprecated.
|
UnsynchronizedByteArrayInputStream(byte[] data,
int offset,
int length)
Deprecated.
|
| Modifier and Type | Method and Description |
|---|---|
int |
available() |
static UnsynchronizedByteArrayInputStream.Builder |
builder()
Constructs a new
UnsynchronizedByteArrayInputStream.Builder. |
void |
mark(int readlimit) |
boolean |
markSupported() |
int |
read() |
int |
read(byte[] dest) |
int |
read(byte[] dest,
int off,
int len) |
void |
reset() |
long |
skip(long n) |
closepublic static final int END_OF_STREAM
@Deprecated public UnsynchronizedByteArrayInputStream(byte[] data)
builder(), UnsynchronizedByteArrayInputStream.Builder, and UnsynchronizedByteArrayInputStream.Builder.get().data - the buffer@Deprecated public UnsynchronizedByteArrayInputStream(byte[] data, int offset)
builder(), UnsynchronizedByteArrayInputStream.Builder, and UnsynchronizedByteArrayInputStream.Builder.get().data - the bufferoffset - the offset into the bufferIllegalArgumentException - if the offset is less than zero@Deprecated public UnsynchronizedByteArrayInputStream(byte[] data, int offset, int length)
builder(), UnsynchronizedByteArrayInputStream.Builder, and UnsynchronizedByteArrayInputStream.Builder.get().data - the bufferoffset - the offset into the bufferlength - the length of the bufferIllegalArgumentException - if the offset or length less than zeropublic static UnsynchronizedByteArrayInputStream.Builder builder()
UnsynchronizedByteArrayInputStream.Builder.UnsynchronizedByteArrayInputStream.Builder.public int available()
available in class InputStreampublic void mark(int readlimit)
mark in class InputStreampublic boolean markSupported()
markSupported in class InputStreampublic int read()
read in class InputStreampublic int read(byte[] dest)
read in class InputStreampublic int read(byte[] dest, int off, int len)
read in class InputStreampublic void reset()
reset in class InputStreampublic long skip(long n)
skip in class InputStreamCopyright © 2002–2023 The Apache Software Foundation. All rights reserved.