java.io.Closeable
, java.io.Flushable
, java.lang.AutoCloseable
public class AccessibleByteArrayOutputStream
extends java.io.ByteArrayOutputStream
Since a copy is not made, users must be careful that no more writes are made to the stream if the array reference is handed off.
Users of this must make the modifications *before* the next write is done, and then release their hold on the array.
Constructor | Description |
---|---|
AccessibleByteArrayOutputStream() |
|
AccessibleByteArrayOutputStream(int size) |
Modifier and Type | Method | Description |
---|---|---|
static java.io.InputStream |
copyStream(java.io.InputStream in,
int bufferSize) |
Copy an InputStream into an array of bytes and return
an InputStream against those bytes.
|
java.io.InputStream |
getInputStream() |
Return an InputStream that wraps the valid byte array.
|
byte[] |
getInternalByteArray() |
The caller promises to set their variable to null
before any other calls to write to this stream are made.
|
void |
readFrom(java.io.InputStream in) |
Read the complete contents of the passed input stream
into this byte array.
|
close, reset, size, toByteArray, toString, toString, toString, toString, write, write, writeTo
public AccessibleByteArrayOutputStream()
public AccessibleByteArrayOutputStream(int size)
public byte[] getInternalByteArray()
public void readFrom(java.io.InputStream in) throws java.io.IOException
java.io.IOException
public java.io.InputStream getInputStream()
public static java.io.InputStream copyStream(java.io.InputStream in, int bufferSize) throws java.io.IOException
in
- InputStream to be copiedbufferSize
- Initial size of the byte arrayjava.io.IOException
- Error reading the streamApache Derby V10.14 Internals - Copyright © 2004,2018 The Apache Software Foundation. All Rights Reserved.