Package com.oracle.bmc.io.internal
Class WrappedByteArrayInputStream
- java.lang.Object
- 
- java.io.InputStream
- 
- java.io.ByteArrayInputStream
- 
- com.oracle.bmc.io.internal.WrappedByteArrayInputStream
 
 
 
- 
- All Implemented Interfaces:
- com.oracle.bmc.http.client.io.DuplicatableInputStream,- Closeable,- AutoCloseable
 
 public class WrappedByteArrayInputStream extends ByteArrayInputStream implements com.oracle.bmc.http.client.io.DuplicatableInputStream Basic extension toByteArrayInputStreamthat lets you create duplicate streams from the same underlying byte buffer.
- 
- 
Field Summary- 
Fields inherited from class java.io.ByteArrayInputStreambuf, count, mark, pos
 
- 
 - 
Constructor SummaryConstructors Constructor Description WrappedByteArrayInputStream(byte[] buf)Create a new stream from the given buffer.WrappedByteArrayInputStream(byte[] buf, int offset, int length)Create a new stream from the given buffer.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description InputStreamduplicate()longlength()Returns the length of the underlying buffer (ie, the length of this stream).- 
Methods inherited from class java.io.ByteArrayInputStreamavailable, close, mark, markSupported, read, read, readAllBytes, readNBytes, reset, skip, transferTo
 - 
Methods inherited from class java.io.InputStreamnullInputStream, read, readNBytes
 
- 
 
- 
- 
- 
Constructor Detail- 
WrappedByteArrayInputStreampublic WrappedByteArrayInputStream(byte[] buf) Create a new stream from the given buffer.- Parameters:
- buf- The byte buffer.
 
 - 
WrappedByteArrayInputStreampublic WrappedByteArrayInputStream(byte[] buf, int offset, int length)Create a new stream from the given buffer.- Parameters:
- buf- The byte buffer.
- offset- The offset in the buffer of the first byte to read.
- length- The maximum number of bytes to read from the buffer.
 
 
- 
 - 
Method Detail- 
lengthpublic long length() Returns the length of the underlying buffer (ie, the length of this stream).- Returns:
- The length of the underlying buffer.
 
 - 
duplicatepublic InputStream duplicate() - Specified by:
- duplicatein interface- com.oracle.bmc.http.client.io.DuplicatableInputStream
 
 
- 
 
-