com.alibaba.dubbo.common.io
Class UnsafeByteArrayOutputStream

java.lang.Object
  extended by java.io.OutputStream
      extended by com.alibaba.dubbo.common.io.UnsafeByteArrayOutputStream
All Implemented Interfaces:
Closeable, Flushable

public class UnsafeByteArrayOutputStream
extends OutputStream

UnsafeByteArrayOutputStream.

Author:
qian.lei

Constructor Summary
UnsafeByteArrayOutputStream()
           
UnsafeByteArrayOutputStream(int size)
           
 
Method Summary
 void close()
           
 void reset()
           
 int size()
           
 byte[] toByteArray()
           
 ByteBuffer toByteBuffer()
           
 String toString()
           
 String toString(String charset)
           
 void write(byte[] b, int off, int len)
           
 void write(int b)
           
 void writeTo(OutputStream out)
           
 
Methods inherited from class java.io.OutputStream
flush, write
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

UnsafeByteArrayOutputStream

public UnsafeByteArrayOutputStream()

UnsafeByteArrayOutputStream

public UnsafeByteArrayOutputStream(int size)
Method Detail

write

public void write(int b)
Specified by:
write in class OutputStream

write

public void write(byte[] b,
                  int off,
                  int len)
Overrides:
write in class OutputStream

size

public int size()

reset

public void reset()

toByteArray

public byte[] toByteArray()

toByteBuffer

public ByteBuffer toByteBuffer()

writeTo

public void writeTo(OutputStream out)
             throws IOException
Throws:
IOException

toString

public String toString()
Overrides:
toString in class Object

toString

public String toString(String charset)
                throws UnsupportedEncodingException
Throws:
UnsupportedEncodingException

close

public void close()
           throws IOException
Specified by:
close in interface Closeable
Overrides:
close in class OutputStream
Throws:
IOException


Copyright © 2012–2017 Alibaba. All rights reserved.