public class DynamicByteArrayOutputStream
extends java.io.OutputStream
| Modifier and Type | Field | Description |
|---|---|---|
private int |
beginPosition |
|
private byte[] |
buf |
|
private static int |
INITIAL_SIZE |
|
private int |
position |
|
private int |
used |
| Constructor | Description |
|---|---|
DynamicByteArrayOutputStream() |
|
DynamicByteArrayOutputStream(byte[] data) |
|
DynamicByteArrayOutputStream(int size) |
|
DynamicByteArrayOutputStream(DynamicByteArrayOutputStream toBeCloned) |
| Modifier and Type | Method | Description |
|---|---|---|
void |
close() |
|
void |
discardLeft(int amountToShrinkBy) |
Shrink the buffer left by the amount given.
|
private void |
expandBuffer(int minExtension) |
Expand the buffer by at least the number of bytes requested in minExtension.
|
int |
getBeginPosition() |
Get the current position in the stream
|
byte[] |
getByteArray() |
Get a reference to the byte array stored in the byte array output
stream.
|
int |
getPosition() |
Get the current position in the stream
|
int |
getUsed() |
Get the number of bytes that was used.
|
void |
reset() |
Reset the stream for reuse
|
void |
setBeginPosition(int newBeginPosition) |
Set the begin position of the stream pointer.
|
void |
setPosition(int newPosition) |
Set the position of the stream pointer.
|
void |
write(byte[] b,
int off,
int len) |
|
void |
write(int b) |
|
(package private) void |
writeCompleteStream(java.io.InputStream dataIn,
int len) |
private static int INITIAL_SIZE
private byte[] buf
private int position
private int used
private int beginPosition
public DynamicByteArrayOutputStream()
public DynamicByteArrayOutputStream(int size)
public DynamicByteArrayOutputStream(byte[] data)
public DynamicByteArrayOutputStream(DynamicByteArrayOutputStream toBeCloned)
public void write(int b)
write in class java.io.OutputStreampublic void write(byte[] b,
int off,
int len)
write in class java.io.OutputStreamvoid writeCompleteStream(java.io.InputStream dataIn,
int len)
throws java.io.IOException
java.io.IOExceptionpublic void close()
close in class java.io.OutputStreampublic void reset()
public byte[] getByteArray()
public int getUsed()
public int getPosition()
public int getBeginPosition()
public void setPosition(int newPosition)
public void setBeginPosition(int newBeginPosition)
public void discardLeft(int amountToShrinkBy)
private void expandBuffer(int minExtension)
Apache Derby V10.13 Internals - Copyright © 2004,2016 The Apache Software Foundation. All Rights Reserved.