Package org.apache.xml.security.utils
Class UnsyncByteArrayOutputStream
- java.lang.Object
-
- java.io.OutputStream
-
- org.apache.xml.security.utils.UnsyncByteArrayOutputStream
-
- All Implemented Interfaces:
java.io.Closeable,java.io.Flushable,java.lang.AutoCloseable
public class UnsyncByteArrayOutputStream extends java.io.OutputStreamA simple Unsynced ByteArrayOutputStream
-
-
Field Summary
Fields Modifier and Type Field Description private byte[]bufprivate static intINITIAL_SIZEprivate intposprivate intsizeprivate static intVM_ARRAY_INDEX_MAX_VALUE
-
Constructor Summary
Constructors Constructor Description UnsyncByteArrayOutputStream()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private voidexpandSize(int newPos)voidreset()byte[]toByteArray()voidwrite(byte[] arg0)voidwrite(byte[] arg0, int arg1, int arg2)voidwrite(int arg0)voidwriteTo(java.io.OutputStream out)Takes the contents of this stream and writes it to the output streamout.
-
-
-
Field Detail
-
VM_ARRAY_INDEX_MAX_VALUE
private static final int VM_ARRAY_INDEX_MAX_VALUE
- See Also:
- Constant Field Values
-
INITIAL_SIZE
private static final int INITIAL_SIZE
- See Also:
- Constant Field Values
-
buf
private byte[] buf
-
size
private int size
-
pos
private int pos
-
-
Method Detail
-
write
public void write(byte[] arg0)
- Overrides:
writein classjava.io.OutputStream
-
write
public void write(byte[] arg0, int arg1, int arg2)- Overrides:
writein classjava.io.OutputStream
-
write
public void write(int arg0)
- Specified by:
writein classjava.io.OutputStream
-
toByteArray
public byte[] toByteArray()
-
reset
public void reset()
-
writeTo
public void writeTo(java.io.OutputStream out) throws java.io.IOExceptionTakes 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:
java.io.IOException- if an error occurs while writing toout.
-
expandSize
private void expandSize(int newPos)
-
-