Package org.apache.flink.core.memory
Class ByteArrayOutputStreamWithPos
- java.lang.Object
-
- java.io.OutputStream
-
- org.apache.flink.core.memory.ByteArrayOutputStreamWithPos
-
- All Implemented Interfaces:
Closeable,Flushable,AutoCloseable
@Internal public class ByteArrayOutputStreamWithPos extends OutputStream
Un-synchronized stream similar to Java's ByteArrayOutputStream that also exposes the current position.
-
-
Constructor Summary
Constructors Constructor Description ByteArrayOutputStreamWithPos()ByteArrayOutputStreamWithPos(int size)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()byte[]getBuf()intgetPosition()voidreset()voidsetPosition(int position)intsize()byte[]toByteArray()StringtoString()voidwrite(byte[] b, int off, int len)voidwrite(int b)-
Methods inherited from class java.io.OutputStream
flush, nullOutputStream, write
-
-
-
-
Method Detail
-
write
public void write(int b)
- Specified by:
writein classOutputStream
-
write
public void write(byte[] b, int off, int len)- Overrides:
writein classOutputStream
-
reset
public void reset()
-
toByteArray
public byte[] toByteArray()
-
size
public int size()
-
getPosition
public int getPosition()
-
setPosition
public void setPosition(int position)
-
close
public void close()
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classOutputStream
-
getBuf
public byte[] getBuf()
-
-