org.apache.struts2.util
Class FastByteArrayOutputStream
java.lang.Object
java.io.OutputStream
org.apache.struts2.util.FastByteArrayOutputStream
- All Implemented Interfaces:
- java.io.Closeable, java.io.Flushable
public class FastByteArrayOutputStream
- extends java.io.OutputStream
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.
Method Summary |
protected void |
addBuffer()
|
void |
close()
|
int |
getSize()
|
byte[] |
toByteArray()
|
java.lang.String |
toString()
|
void |
write(byte[] data,
int offset,
int length)
|
void |
write(int datum)
|
void |
writeTo(javax.servlet.jsp.JspWriter out,
java.lang.String encoding)
This is a patched method (standard) |
void |
writeTo(java.io.OutputStream out)
|
void |
writeTo(java.io.RandomAccessFile out)
|
void |
writeTo(java.io.Writer out,
java.lang.String encoding)
This is a patched method (added for common Writer, needed for tests) |
Methods inherited from class java.io.OutputStream |
flush, write |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
FastByteArrayOutputStream
public FastByteArrayOutputStream()
FastByteArrayOutputStream
public FastByteArrayOutputStream(int blockSize)
writeTo
public void writeTo(java.io.OutputStream out)
throws java.io.IOException
- Throws:
java.io.IOException
writeTo
public void writeTo(java.io.RandomAccessFile out)
throws java.io.IOException
- Throws:
java.io.IOException
writeTo
public void writeTo(java.io.Writer out,
java.lang.String encoding)
throws java.io.IOException
- This is a patched method (added for common Writer, needed for tests)
- Parameters:
out
- Writerencoding
- Encoding
- Throws:
java.io.IOException
- If some output failed
writeTo
public void writeTo(javax.servlet.jsp.JspWriter out,
java.lang.String encoding)
throws java.io.IOException
- This is a patched method (standard)
- Parameters:
out
- Writerencoding
- Encoding
- Throws:
java.io.IOException
- If some output failed
getSize
public int getSize()
toByteArray
public byte[] toByteArray()
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object
addBuffer
protected void addBuffer()
write
public void write(int datum)
throws java.io.IOException
- Specified by:
write
in class java.io.OutputStream
- Throws:
java.io.IOException
write
public void write(byte[] data,
int offset,
int length)
throws java.io.IOException
- Overrides:
write
in class java.io.OutputStream
- Throws:
java.io.IOException
close
public void close()
- Specified by:
close
in interface java.io.Closeable
- Overrides:
close
in class java.io.OutputStream
Copyright © 2000-2011 Apache Software Foundation. All Rights Reserved.