toByteArray()
and toString()
. Closing a ByteArrayOutputStream has no effect. The methods in this class can be called after the stream has been closed without generating an IOException. This is an alternative implementation of the {@link java.io.ByteArrayOutputStream}class. The original implementation only allocates 32 bytes at the beginning. As this class is designed for heavy duty it starts at 1024 bytes. In contrast to the original it doesn't reallocate the whole memory block but allocates additional buffers. This way no buffers need to be garbage collected and the contents don't have to be copied to the new buffer. This class is designed to behave exactly like the original. The only exception is the deprecated toString(int) method that has been ignored.
@version $Id: ByteArrayOutputStream.java 1304052 2012-03-22 20:55:29Z ggregory $
ByteArray
�����ڴ濽��������ByteArrayOutputStream
ʵ�֡�
@author Michael Zhou
ByteArrayOutputStream
替换方案, 执行toByteArray()
方法时返回的是只读的内部字节数组, 避免了没有必要的字节复制. 本代码移植自IBM developer works精彩文章, 参见package文档.
@author Michael Zhou
@author wendell
@version $Id: ByteArrayOutputStream.java 593 2004-02-26 13:47:19Z baobao $
toByteArray()
and toString()
. Closing a ByteArrayOutputStream has no effect. The methods in this class can be called after the stream has been closed without generating an IOException. @author Arthur van Hoff @since JDK1.0
toByteArray()
and toString()
. Closing a ByteArrayOutputStream has no effect. The methods in this class can be called after the stream has been closed without generating an IOException. This is an alternative implementation of the java.io.ByteArrayOutputStream class. The original implementation only allocates 32 bytes at the beginning. As this class is designed for heavy duty it starts at 1024 bytes. In contrast to the original it doesn't reallocate the whole memory block but allocates additional buffers. This way no buffers need to be garbage collected and the contents don't have to be copied to the new buffer. This class is designed to behave exactly like the original. The only exception is the deprecated toString(int) method that has been ignored.
@author Jeremias Maerki
The data can be retrieved using toByteArray()
and toString()
.
Closing a ByteArrayOutputStream has no effect. The methods in this class can be called after the stream has been closed without generating an IOException.
This is an alternative implementation of the java.io.ByteArrayOutputStream class. The original implementation only allocates 32 bytes at the beginning. As this class is designed for heavy duty it starts at 1024 bytes. In contrast to the original it doesn't reallocate the whole memory block but allocates additional buffers. This way no buffers need to be garbage collected and the contents don't have to be copied to the new buffer. This class is designed to behave exactly like the original. The only exception is the deprecated toString(int) method that has been ignored. @author Jeremias Maerki @version $Id: ByteArrayOutputStream.java 369075 2006-01-14 18:23:42Z scolebourne $
The data can be retrieved using toByteArray()
and toString()
.
Closing a ByteArrayOutputStream has no effect. The methods in this class can be called after the stream has been closed without generating an IOException.
This is an alternative implementation of the java.io.ByteArrayOutputStream class. The original implementation only allocates 32 bytes at the beginning. As this class is designed for heavy duty it starts at 1024 bytes. In contrast to the original it doesn't reallocate the whole memory block but allocates additional buffers. This way no buffers need to be garbage collected and the contents don't have to be copied to the new buffer. This class is designed to behave exactly like the original. The only exception is the deprecated toString(int) method that has been ignored. @author Jeremias Maerki @version $Id$
The data can be retrieved using toByteArray()
and toString()
.
Closing a ByteArrayOutputStream has no effect. The methods in this class can be called after the stream has been closed without generating an IOException.
This is an alternative implementation of the {@link java.io.ByteArrayOutputStream}class. The original implementation only allocates 32 bytes at the beginning. As this class is designed for heavy duty it starts at 1024 bytes. In contrast to the original it doesn't reallocate the whole memory block but allocates additional buffers. This way no buffers need to be garbage collected and the contents don't have to be copied to the new buffer. This class is designed to behave exactly like the original. The only exception is the deprecated toString(int) method that has been ignored. @version $Id: ByteArrayOutputStream.java 1304052 2012-03-22 20:55:29Z ggregory $
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|