org.apache.hadoop.hive.ql.io
Class NonSyncDataOutputBuffer
java.lang.Object
java.io.OutputStream
java.io.FilterOutputStream
java.io.DataOutputStream
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.
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.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
NonSyncDataOutputBuffer
public NonSyncDataOutputBuffer()
- Constructs a new empty buffer.
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 © 2013 The Apache Software Foundation