Package org.apache.xml.security.utils
Class UnsyncByteArrayOutputStream
java.lang.Object
java.io.OutputStream
org.apache.xml.security.utils.UnsyncByteArrayOutputStream
- All Implemented Interfaces:
Closeable
,Flushable
,AutoCloseable
A simple Unsynced ByteArrayOutputStream
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate byte[]
private static final int
private int
private int
private static final int
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate void
expandSize
(int newPos) void
reset()
byte[]
void
write
(byte[] arg0) void
write
(byte[] arg0, int arg1, int arg2) void
write
(int arg0) void
writeTo
(OutputStream out) Takes the contents of this stream and writes it to the output streamout
.Methods inherited from class java.io.OutputStream
close, flush, nullOutputStream
-
Field Details
-
VM_ARRAY_INDEX_MAX_VALUE
private static final int VM_ARRAY_INDEX_MAX_VALUE- See Also:
-
INITIAL_SIZE
private static final int INITIAL_SIZE- See Also:
-
buf
private byte[] buf -
size
private int size -
pos
private int pos
-
-
Constructor Details
-
UnsyncByteArrayOutputStream
public UnsyncByteArrayOutputStream()
-
-
Method Details
-
write
public void write(byte[] arg0) - Overrides:
write
in classOutputStream
-
write
public void write(byte[] arg0, int arg1, int arg2) - Overrides:
write
in classOutputStream
-
write
public void write(int arg0) - Specified by:
write
in classOutputStream
-
toByteArray
public byte[] toByteArray() -
reset
public void reset() -
writeTo
Takes the contents of this stream and writes it to the output streamout
.- Parameters:
out
- an OutputStream on which to write the contents of this stream.- Throws:
IOException
- if an error occurs while writing toout
.
-
expandSize
private void expandSize(int newPos)
-