public class UnsynchronizedByteArrayInputStream
extends java.io.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) |
public 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 bufferjava.lang.IllegalArgumentException
- 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 bufferjava.lang.IllegalArgumentException
- if the offset or length less than zeropublic static UnsynchronizedByteArrayInputStream.Builder builder()
UnsynchronizedByteArrayInputStream.Builder
.UnsynchronizedByteArrayInputStream.Builder
.public int available()
available
in class java.io.InputStream
public void mark(int readlimit)
mark
in class java.io.InputStream
public boolean markSupported()
markSupported
in class java.io.InputStream
public int read()
read
in class java.io.InputStream
public int read(byte[] dest)
read
in class java.io.InputStream
public int read(byte[] dest, int off, int len)
read
in class java.io.InputStream
public void reset()
reset
in class java.io.InputStream
public long skip(long n)
skip
in class java.io.InputStream
Copyright © 2010 - 2023 Adobe. All Rights Reserved