com.alibaba.dubbo.rpc.protocol.thrift.io
Class RandomAccessByteArrayOutputStream

java.lang.Object
  extended by java.io.OutputStream
      extended by com.alibaba.dubbo.rpc.protocol.thrift.io.RandomAccessByteArrayOutputStream
All Implemented Interfaces:
Closeable, Flushable

public class RandomAccessByteArrayOutputStream
extends OutputStream

Author:
kimi

Constructor Summary
RandomAccessByteArrayOutputStream()
           
RandomAccessByteArrayOutputStream(int size)
           
 
Method Summary
 void close()
           
 void reset()
           
 void setWriteIndex(int index)
           
 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

RandomAccessByteArrayOutputStream

public RandomAccessByteArrayOutputStream()

RandomAccessByteArrayOutputStream

public RandomAccessByteArrayOutputStream(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()

setWriteIndex

public void setWriteIndex(int index)

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.