|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.io.OutputStream
java.io.ByteArrayOutputStream
org.apache.derby.iapi.services.io.AccessibleByteArrayOutputStream
public class AccessibleByteArrayOutputStream
This allows us to get to the byte array to go back and edit contents or get the array without having a copy made.
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.
Field Summary |
---|
Fields inherited from class java.io.ByteArrayOutputStream |
---|
buf, count |
Constructor Summary | |
---|---|
AccessibleByteArrayOutputStream()
|
|
AccessibleByteArrayOutputStream(int size)
|
Method Summary | |
---|---|
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. |
Methods inherited from class java.io.ByteArrayOutputStream |
---|
close, reset, size, toByteArray, toString, toString, toString, write, write, writeTo |
Methods inherited from class java.io.OutputStream |
---|
flush, write |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public AccessibleByteArrayOutputStream()
public AccessibleByteArrayOutputStream(int size)
Method Detail |
---|
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 array
java.io.IOException
- Error reading the stream
|
Built on Thu 2011-03-10 11:54:14+0000, from revision ??? | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |