org.apache.hadoop.hive.common.io
Class NonSyncByteArrayOutputStream

java.lang.Object
  extended by java.io.OutputStream
      extended by java.io.ByteArrayOutputStream
          extended by org.apache.hadoop.hive.common.io.NonSyncByteArrayOutputStream
All Implemented Interfaces:
Closeable, Flushable
Direct Known Subclasses:
ByteStream.Output

public class NonSyncByteArrayOutputStream
extends ByteArrayOutputStream

A thread-not-safe version of ByteArrayOutputStream, which removes all synchronized modifiers.


Field Summary
 
Fields inherited from class java.io.ByteArrayOutputStream
buf, count
 
Constructor Summary
NonSyncByteArrayOutputStream()
           
NonSyncByteArrayOutputStream(int size)
           
 
Method Summary
 byte[] getData()
           
 int getLength()
           
 void reset()
          
 void write(byte[] b, int off, int len)
          
 void write(DataInput in, int length)
           
 void write(int b)
          
 void writeTo(OutputStream out)
          
 
Methods inherited from class java.io.ByteArrayOutputStream
close, size, toByteArray, toString, toString, toString
 
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
 

Constructor Detail

NonSyncByteArrayOutputStream

public NonSyncByteArrayOutputStream(int size)

NonSyncByteArrayOutputStream

public NonSyncByteArrayOutputStream()
Method Detail

getData

public byte[] getData()

getLength

public int getLength()

reset

public void reset()

Overrides:
reset in class ByteArrayOutputStream

write

public void write(DataInput in,
                  int length)
           throws IOException
Throws:
IOException

write

public void write(int b)

Overrides:
write in class ByteArrayOutputStream

write

public void write(byte[] b,
                  int off,
                  int len)

Overrides:
write in class ByteArrayOutputStream

writeTo

public void writeTo(OutputStream out)
             throws IOException

Overrides:
writeTo in class ByteArrayOutputStream
Throws:
IOException


Copyright © 2013 The Apache Software Foundation