Package org.apache.commons.io.input
Class UnsynchronizedByteArrayInputStream
java.lang.Object
java.io.InputStream
org.apache.commons.io.input.UnsynchronizedByteArrayInputStream
- All Implemented Interfaces:
Closeable,AutoCloseable
This is an alternative to
ByteArrayInputStream which removes the synchronization overhead for non-concurrent access; as such this class is
not thread-safe.
To build an instance, use UnsynchronizedByteArrayInputStream.Builder.
- Since:
- 2.7
- See Also:
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionUnsynchronizedByteArrayInputStream(byte[] data) Deprecated.UnsynchronizedByteArrayInputStream(byte[] data, int offset) Deprecated.UnsynchronizedByteArrayInputStream(byte[] data, int offset, int length) Deprecated. -
Method Summary
Methods inherited from class java.io.InputStream
close
-
Field Details
-
END_OF_STREAM
The end of stream marker.- See Also:
-
-
Constructor Details
-
UnsynchronizedByteArrayInputStream
Deprecated.Constructs a new byte array input stream.- Parameters:
data- the buffer
-
UnsynchronizedByteArrayInputStream
Deprecated.Constructs a new byte array input stream.- Parameters:
data- the bufferoffset- the offset into the buffer- Throws:
IllegalArgumentException- if the offset is less than zero
-
UnsynchronizedByteArrayInputStream
Deprecated.Constructs a new byte array input stream.- Parameters:
data- the bufferoffset- the offset into the bufferlength- the length of the buffer- Throws:
IllegalArgumentException- if the offset or length less than zero
-
-
Method Details
-
builder
Constructs a newUnsynchronizedByteArrayInputStream.Builder.- Returns:
- a new
UnsynchronizedByteArrayInputStream.Builder.
-
available
- Overrides:
availablein classInputStream
-
mark
- Overrides:
markin classInputStream
-
markSupported
- Overrides:
markSupportedin classInputStream
-
read
- Specified by:
readin classInputStream
-
read
- Overrides:
readin classInputStream
-
read
- Overrides:
readin classInputStream
-
reset
- Overrides:
resetin classInputStream
-
skip
- Overrides:
skipin classInputStream
-
builder(),UnsynchronizedByteArrayInputStream.Builder, andUnsynchronizedByteArrayInputStream.Builder.get().