org.apache.hadoop.hive.ql.io
Class NonSyncDataOutputBuffer

java.lang.Object
  extended by java.io.OutputStream
      extended by java.io.FilterOutputStream
          extended by java.io.DataOutputStream
              extended by org.apache.hadoop.hive.ql.io.NonSyncDataOutputBuffer
All Implemented Interfaces:
Closeable, DataOutput, Flushable

public class NonSyncDataOutputBuffer
extends DataOutputStream

A thread-not-safe version of Hadoop's DataOutputBuffer, which removes all synchronized modifiers.


Constructor Summary
NonSyncDataOutputBuffer()
          Constructs a new empty buffer.
 
Method Summary
 byte[] getData()
          Returns the current contents of the buffer.
 int getLength()
          Returns the length of the valid data currently in the buffer.
 NonSyncDataOutputBuffer reset()
          Resets the buffer to empty.
 void write(byte[] b, int off, int len)
           
 void write(DataInput in, int length)
          Writes bytes from a DataInput directly into the buffer.
 void write(int b)
           
 
Methods inherited from class java.io.DataOutputStream
flush, size, writeBoolean, writeByte, writeBytes, writeChar, writeChars, writeDouble, writeFloat, writeInt, writeLong, writeShort, writeUTF
 
Methods inherited from class java.io.FilterOutputStream
close, write
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.io.DataOutput
write
 

Constructor Detail

NonSyncDataOutputBuffer

public NonSyncDataOutputBuffer()
Constructs a new empty buffer.

Method Detail

getData

public byte[] getData()
Returns the current contents of the buffer. Data is only valid to getLength().


getLength

public int getLength()
Returns the length of the valid data currently in the buffer.


reset

public NonSyncDataOutputBuffer reset()
Resets the buffer to empty.


write

public void write(DataInput in,
                  int length)
           throws IOException
Writes bytes from a DataInput directly into the buffer.

Throws:
IOException

write

public void write(int b)
           throws IOException
Specified by:
write in interface DataOutput
Overrides:
write in class DataOutputStream
Throws:
IOException

write

public void write(byte[] b,
                  int off,
                  int len)
           throws IOException
Specified by:
write in interface DataOutput
Overrides:
write in class DataOutputStream
Throws:
IOException


Copyright © 2014 The Apache Software Foundation. All rights reserved.