|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.io.OutputStream
org.apache.xml.security.stax.impl.util.UnsynchronizedByteArrayOutputStream
public class UnsynchronizedByteArrayOutputStream
| Field Summary | |
|---|---|
protected byte[] |
buf
The byte array containing the bytes written. |
protected int |
count
The number of bytes written. |
| Constructor Summary | |
|---|---|
UnsynchronizedByteArrayOutputStream()
Constructs a new ByteArrayOutputStream with a default size of 32 bytes. |
|
UnsynchronizedByteArrayOutputStream(int size)
Constructs a new ByteArrayOutputStream with a default size of
size bytes. |
|
| Method Summary | |
|---|---|
void |
reset()
Resets this stream to the beginning of the underlying byte array. |
int |
size()
Returns the total number of bytes written to this stream so far. |
byte[] |
toByteArray()
Returns the contents of this ByteArrayOutputStream as a byte array. |
String |
toString()
Returns the contents of this ByteArrayOutputStream as a string. |
String |
toString(String enc)
Returns the contents of this ByteArrayOutputStream as a string converted according to the encoding declared in enc. |
void |
write(byte[] buffer,
int offset,
int len)
Writes count bytes from the byte array buffer starting at
offset index to this stream. |
void |
write(int oneByte)
Writes the specified byte oneByte to the OutputStream. |
void |
writeTo(OutputStream out)
Takes the contents of this stream and writes it to the output stream out. |
| Methods inherited from class java.io.OutputStream |
|---|
close, flush, write |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected byte[] buf
protected int count
| Constructor Detail |
|---|
public UnsynchronizedByteArrayOutputStream()
public UnsynchronizedByteArrayOutputStream(int size)
ByteArrayOutputStream with a default size of
size bytes. If more than size bytes are written to this
instance, the underlying byte array will expand.
size - initial size for the underlying byte array, must be
non-negative.
IllegalArgumentException - if size < 0.| Method Detail |
|---|
public void reset()
public int size()
public byte[] toByteArray()
public String toString()
toString in class Object
public String toString(String enc)
throws UnsupportedEncodingException
enc.
enc - a string representing the encoding to use when translating
this stream to a string.
UnsupportedEncodingException - if the provided encoding is not supported.
public void write(byte[] buffer,
int offset,
int len)
count bytes from the byte array buffer starting at
offset index to this stream.
write in class OutputStreambuffer - the buffer to be written.offset - the initial position in buffer to retrieve bytes.len - the number of bytes of buffer to write.
NullPointerException - if buffer is null.
IndexOutOfBoundsException - if offset < 0 or len < 0, or if
offset + len is greater than the length of
buffer.public void write(int oneByte)
oneByte to the OutputStream. Only the
low order byte of oneByte is written.
write in class OutputStreamoneByte - the byte to be written.
public void writeTo(OutputStream out)
throws IOException
out.
out - an OutputStream on which to write the contents of this stream.
IOException - if an error occurs while writing to out.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||