Top Description Fields Constructors Methods
com.oracle.bmc.io.internal

public Class WrappedByteArrayInputStream

extends ByteArrayInputStream
implements DuplicatableInputStream
Class Inheritance
All Implemented Interfaces
com.oracle.bmc.http.client.io.DuplicatableInputStream
Imports
java.io.ByteArrayInputStream, .InputStream, com.oracle.bmc.http.client.io.DuplicatableInputStream

Basic extension to ByteArrayInputStream that lets you create duplicate streams from the same underlying byte buffer.

Field Summary

Modifier and TypeField and Description
private int
private int
Inherited from java.io.ByteArrayInputStream:
bufcountmarkpos

Constructor Summary

AccessConstructor and Description
public
WrappedByteArrayInputStream(byte[]
The byte buffer.
buf
)

Create a new stream from the given buffer.

public
WrappedByteArrayInputStream(byte[]
The byte buffer.
buf
,
int
The offset in the buffer of the first byte to read.
offset
,
int
The maximum number of bytes to read from the buffer.
length
)

Create a new stream from the given buffer.

Method Summary

Modifier and TypeMethod and Description
public InputStream
duplicate()

Implements com.oracle.bmc.http.client.io.DuplicatableInputStream.duplicate.

Produces a duplicate stream of the source (from its start) that can be used in parallel to the original stream (ie, thread safe).

public long

Returns:

The length of the underlying buffer.
length
()

Returns the length of the underlying buffer (ie, the length of this stream).

Inherited from java.io.ByteArrayInputStream:
availableclosemarkmarkSupportedreadreadreadAllBytesreadNBytesresetskiptransferTo

Field Detail

lengthback to summary
private int length
offsetback to summary
private int offset

Constructor Detail

WrappedByteArrayInputStreamback to summary
public WrappedByteArrayInputStream(byte[] buf)

Create a new stream from the given buffer.

Parameters
buf:byte[]

The byte buffer.

WrappedByteArrayInputStreamback to summary
public WrappedByteArrayInputStream(byte[] buf, int offset, int length)

Create a new stream from the given buffer.

Parameters
buf:byte[]

The byte buffer.

offset:int

The offset in the buffer of the first byte to read.

length:int

The maximum number of bytes to read from the buffer.

Method Detail

duplicateback to summary
public InputStream duplicate()

Implements com.oracle.bmc.http.client.io.DuplicatableInputStream.duplicate.

Doc from com.oracle.bmc.http.client.io.DuplicatableInputStream.duplicate.

Produces a duplicate stream of the source (from its start) that can be used in parallel to the original stream (ie, thread safe).

Returns:InputStream

A new input stream instance.

Annotations
@Override
lengthback to summary
public long length()

Returns the length of the underlying buffer (ie, the length of this stream).

Returns:long

The length of the underlying buffer.