public abstract class AbstractBinaryWriter extends Object implements BinaryWriter
MemorySegment (its capacity grows
automatically).
If write a format binary:
1. New a writer.
2. Write each field by writeXX or setNullAt. (Variable length fields can not be written
repeatedly.)
3. Invoke BinaryWriter.complete().
If want to reuse this writer, please invoke BinaryWriter.reset() first.
| 限定符和类型 | 字段和说明 |
|---|---|
protected int |
cursor |
protected org.apache.flink.core.memory.DataOutputViewStreamWrapper |
outputView |
protected org.apache.flink.core.memory.MemorySegment |
segment |
| 构造器和说明 |
|---|
AbstractBinaryWriter() |
| 限定符和类型 | 方法和说明 |
|---|---|
protected abstract void |
afterGrow()
After grow, need point to new memory.
|
protected void |
ensureCapacity(int neededSize) |
protected abstract int |
getFieldOffset(int pos)
Get field offset.
|
protected static int |
roundNumberOfBytesToNearestWord(int numBytes) |
protected abstract void |
setNullBit(int ordinal) |
protected abstract void |
setOffsetAndSize(int pos,
int offset,
long size)
Set offset and size to fix len part.
|
void |
writeArray(int pos,
BaseArray input,
BaseArraySerializer serializer) |
void |
writeBinary(int pos,
byte[] bytes) |
void |
writeDecimal(int pos,
Decimal value,
int precision) |
void |
writeGeneric(int pos,
BinaryGeneric input,
BinaryGenericSerializer serializer) |
void |
writeMap(int pos,
BaseMap input,
BaseMapSerializer serializer) |
void |
writeRow(int pos,
BaseRow input,
BaseRowSerializer serializer) |
void |
writeString(int pos,
BinaryString input)
|
void |
writeTimestamp(int pos,
SqlTimestamp value,
int precision) |
protected void |
zeroOutPaddingBytes(int numBytes) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcomplete, reset, setNullAt, write, writeBoolean, writeByte, writeDouble, writeFloat, writeInt, writeLong, writeShortprotected org.apache.flink.core.memory.MemorySegment segment
protected int cursor
protected org.apache.flink.core.memory.DataOutputViewStreamWrapper outputView
protected abstract void setOffsetAndSize(int pos,
int offset,
long size)
protected abstract int getFieldOffset(int pos)
protected abstract void afterGrow()
protected abstract void setNullBit(int ordinal)
public void writeString(int pos,
BinaryString input)
writeString 在接口中 BinaryWriterpublic void writeArray(int pos,
BaseArray input,
BaseArraySerializer serializer)
writeArray 在接口中 BinaryWriterpublic void writeMap(int pos,
BaseMap input,
BaseMapSerializer serializer)
writeMap 在接口中 BinaryWriterpublic void writeGeneric(int pos,
BinaryGeneric input,
BinaryGenericSerializer serializer)
writeGeneric 在接口中 BinaryWriterpublic void writeRow(int pos,
BaseRow input,
BaseRowSerializer serializer)
writeRow 在接口中 BinaryWriterpublic void writeBinary(int pos,
byte[] bytes)
writeBinary 在接口中 BinaryWriterpublic void writeDecimal(int pos,
Decimal value,
int precision)
writeDecimal 在接口中 BinaryWriterpublic void writeTimestamp(int pos,
SqlTimestamp value,
int precision)
writeTimestamp 在接口中 BinaryWriterprotected void zeroOutPaddingBytes(int numBytes)
protected void ensureCapacity(int neededSize)
protected static int roundNumberOfBytesToNearestWord(int numBytes)
Copyright © 2014–2020 The Apache Software Foundation. All rights reserved.