com.alibaba.simpleimage.io
类 ByteArrayOutputStream

java.lang.Object
  继承者 java.io.OutputStream
      继承者 com.alibaba.simpleimage.io.ByteArrayOutputStream
所有已实现的接口:
Closeable, Flushable

public class ByteArrayOutputStream
extends OutputStream

本代码专为图片缓存使用,故默认缓冲区设得比较大 非同步的ByteArrayOutputStream替换方案, 执行toByteArray()方法时返回的是只读的内部字节数组, 避免了没有必要的字节复制. 本代码移植自IBM developer works精彩文章, 参见package文档.

版本:
$Id: ByteArrayOutputStream.java 593 2004-02-26 13:47:19Z baobao $
作者:
Michael Zhou, wendell

构造方法摘要
ByteArrayOutputStream()
           
ByteArrayOutputStream(int initialBufferSize)
           
 
方法摘要
 void close()
           
 void reset()
           
 ByteArray toByteArray()
           
 InputStream toInputStream()
           
 void write(byte[] data, int offset, int length)
           
 void write(int datum)
           
 void writeTo(OutputStream out)
           
 
从类 java.io.OutputStream 继承的方法
flush, write
 
从类 java.lang.Object 继承的方法
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

构造方法详细信息

ByteArrayOutputStream

public ByteArrayOutputStream()

ByteArrayOutputStream

public ByteArrayOutputStream(int initialBufferSize)
方法详细信息

write

public void write(int datum)
           throws IOException
指定者:
OutputStream 中的 write
抛出:
IOException

write

public void write(byte[] data,
                  int offset,
                  int length)
           throws IOException
覆盖:
OutputStream 中的 write
抛出:
IOException

close

public void close()
指定者:
接口 Closeable 中的 close
覆盖:
OutputStream 中的 close

writeTo

public void writeTo(OutputStream out)
             throws IOException
抛出:
IOException

toByteArray

public ByteArray toByteArray()

toInputStream

public InputStream toInputStream()

reset

public void reset()
           throws IOException
抛出:
IOException


Copyright © 2012–2013 Alibaba Group. All rights reserved.