Class ByteBufferDataWriter
java.lang.Object
java.io.OutputStream
org.apache.hadoop.mapred.nativetask.buffer.DataOutputStream
org.apache.hadoop.mapred.nativetask.buffer.ByteBufferDataWriter
- All Implemented Interfaces:
Closeable,DataOutput,Flushable,AutoCloseable
DataOutputStream implementation which buffers data in a fixed-size
ByteBuffer.
When the byte buffer has filled up, synchronously passes the buffer
to a downstream NativeDataTarget.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()voidflush()booleanCheck whether there is unflushed data stored in the streambooleanshortOfSpace(int dataLength) Check whether this buffer has enough space to store length of bytesvoidwrite(byte[] b, int off, int len) voidwrite(int v) final voidwriteBoolean(boolean v) final voidwriteByte(int v) final voidwriteBytes(String s) final voidwriteChar(int v) final voidwriteChars(String s) final voidwriteDouble(double v) final voidwriteFloat(float v) final voidwriteInt(int v) final voidwriteLong(long v) final voidwriteShort(int v) final voidMethods inherited from class java.io.OutputStream
nullOutputStream, writeMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.io.DataOutput
write
-
Constructor Details
-
ByteBufferDataWriter
-
-
Method Details
-
write
- Specified by:
writein interfaceDataOutput- Specified by:
writein classOutputStream- Throws:
IOException
-
shortOfSpace
Description copied from class:DataOutputStreamCheck whether this buffer has enough space to store length of bytes- Specified by:
shortOfSpacein classDataOutputStream- Parameters:
dataLength- length of bytes- Throws:
IOException
-
write
- Specified by:
writein interfaceDataOutput- Overrides:
writein classOutputStream- Throws:
IOException
-
flush
- Specified by:
flushin interfaceFlushable- Overrides:
flushin classOutputStream- Throws:
IOException
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classOutputStream- Throws:
IOException
-
writeBoolean
- Throws:
IOException
-
writeByte
- Throws:
IOException
-
writeShort
- Throws:
IOException
-
writeChar
- Throws:
IOException
-
writeInt
- Throws:
IOException
-
writeLong
- Throws:
IOException
-
writeFloat
- Throws:
IOException
-
writeDouble
- Throws:
IOException
-
writeBytes
- Throws:
IOException
-
writeChars
- Throws:
IOException
-
writeUTF
- Throws:
IOException
-
hasUnFlushedData
public boolean hasUnFlushedData()Description copied from class:DataOutputStreamCheck whether there is unflushed data stored in the stream- Specified by:
hasUnFlushedDatain classDataOutputStream
-