Package org.apache.struts2.util
Class FastByteArrayOutputStream
java.lang.Object
java.io.OutputStream
org.apache.struts2.util.FastByteArrayOutputStream
- All Implemented Interfaces:
- Closeable,- Flushable,- AutoCloseable
A speedy implementation of ByteArrayOutputStream. It's not synchronized, and it
 does not copy buffers when it's expanded. There's also no copying of the internal buffer
 if it's contents is extracted with the writeTo(stream) method.
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionprotected voidvoidclose()intgetSize()byte[]toString()voidwrite(byte[] data, int offset, int length) voidwrite(int datum) voidThis is a patched method (standard)voidwriteTo(OutputStream out) voidwriteTo(RandomAccessFile out) voidThis is a patched method (added for common Writer, needed for tests)Methods inherited from class java.io.OutputStreamflush, nullOutputStream, write
- 
Constructor Details- 
FastByteArrayOutputStreampublic FastByteArrayOutputStream()
- 
FastByteArrayOutputStreampublic FastByteArrayOutputStream(int blockSize) 
 
- 
- 
Method Details- 
writeTo- Throws:
- IOException
 
- 
writeTo- Throws:
- IOException
 
- 
writeToThis is a patched method (added for common Writer, needed for tests)- Parameters:
- out- Writer
- encoding- Encoding
- Throws:
- IOException- If some output failed
 
- 
writeToThis is a patched method (standard)- Parameters:
- out- Writer
- encoding- Encoding
- Throws:
- IOException- If some output failed
 
- 
getSizepublic int getSize()
- 
toByteArraypublic byte[] toByteArray()
- 
toString
- 
addBufferprotected void addBuffer()
- 
write- Specified by:
- writein class- OutputStream
- Throws:
- IOException
 
- 
write- Overrides:
- writein class- OutputStream
- Throws:
- IOException
 
- 
closepublic void close()- Specified by:
- closein interface- AutoCloseable
- Specified by:
- closein interface- Closeable
- Overrides:
- closein class- OutputStream
 
 
-