public class DataOutputBlobWriter<S extends MessageSchema<S>> extends ChannelWriter
| Modifier and Type | Field and Description |
|---|---|
protected Pipe<S> |
backingPipe |
| Constructor and Description |
|---|
DataOutputBlobWriter(Pipe<S> p) |
| Modifier and Type | Method and Description |
|---|---|
int |
absolutePosition() |
void |
absolutePosition(int absolutePosition) |
ChannelWriter |
append(char c) |
ChannelWriter |
append(CharSequence s) |
ChannelWriter |
append(CharSequence csq,
int start,
int end) |
protected static <T extends MessageSchema<T>> |
checkLimit(DataOutputBlobWriter<T> that,
int x)
Internal function only used when dependent classes want to add bounds check per method call.
|
static <T extends MessageSchema<T>> |
closeHighLevelField(DataOutputBlobWriter<T> writer,
int targetFieldLoc) |
int |
closeHighLevelField(int targetFieldLoc)
Closes field and prevents additional data from being written
|
int |
closeLowLevelField()
Closes field and prevents additional data from being written
|
static <T extends MessageSchema<T>> |
closeLowLevelField(DataOutputBlobWriter<T> writer)
Close field and record its length as the number of bytes consumed by the BlobWriter
|
static <T extends MessageSchema<T>> |
closeLowLeveLField(DataOutputBlobWriter<T> writer,
int len) |
static <T extends MessageSchema<T>> |
closeLowLevelMaxVarLenField(DataOutputBlobWriter<T> writer)
Ignore the length of this field and close it consuming all the available blob space for this field.
|
static <T extends MessageSchema<T>> |
commitBackData(DataOutputBlobWriter<T> writer,
int structId) |
void |
consume(byte value) |
void |
consume(byte[] backing,
int pos,
int len,
int mask) |
static void |
copyBackData(DataOutputBlobWriter that,
byte[] backing,
int start,
int copyLen,
int byteMask2) |
void |
debug() |
void |
debugAsUTF8() |
void |
debugAsUTF8(Appendable target) |
static <T extends MessageSchema<T>> |
encodeAsUTF8(DataOutputBlobWriter<T> writer,
CharSequence s) |
static <T extends MessageSchema<T>> |
encodeAsUTF8(DataOutputBlobWriter<T> writer,
CharSequence s,
int position,
int length) |
static <T extends MessageSchema<T>> |
encodeAsUTF8(DataOutputBlobWriter<T> writer,
CharSequence s,
int sPos,
int sLen,
int mask,
byte[] localBuf,
int pos) |
Pipe<S> |
getPipe() |
static <T extends MessageSchema<T>> |
getStructType(DataOutputBlobWriter<T> writer) |
static <T extends MessageSchema<T>> |
lastBackPositionOfIndex(DataOutputBlobWriter<T> writer) |
int |
length()
Gets length of data written so far to ChannelWriter and passes data as int
|
static <T extends MessageSchema<T>> |
length(DataOutputBlobWriter<T> writer) |
void |
openField() |
static <T extends MessageSchema<T>> |
openField(DataOutputBlobWriter<T> writer) |
static <T extends MessageSchema<T>> |
openFieldAtPosition(DataOutputBlobWriter<T> writer,
int workingBlobHeadPosition) |
int |
position()
Gets position of data written so far to ChannelWriter and passes data as int
|
int |
remaining()
Reads data written so far to ChannelWriter and determines how many bytes are remaining
|
void |
replicate(Appendable target) |
void |
replicate(DataOutputBlobWriter<?> writer)
Data written so far is directly copied to the destination writer.
|
boolean |
reportObjectSizes(Appendable target)
Used for debugging, to find if object is over a certain size
|
void |
reset()
Drop everything written so far and return cursor to beginning of the stream
|
static <T extends MessageSchema<T>> |
setIntBackData(DataOutputBlobWriter<T> writer,
int value,
int pos) |
static <T extends MessageSchema<T>> |
setStructType(DataOutputBlobWriter<T> writer,
int value) |
long |
startsWith(TrieParserReader reader,
TrieParser tp) |
static <T extends MessageSchema<T>> |
structTypeValidation(DataOutputBlobWriter<T> writer,
int value) |
StructuredWriter |
structured() |
byte[] |
toByteArray()
Gets byte data written so far to ChannelWriter and passes data to byte array
|
static <T extends MessageSchema<T>> |
tryClearIntBackData(DataOutputBlobWriter<T> writer,
int intCount) |
void |
write(byte[] b)
Writes byte array to ChannelWriter
|
void |
write(byte[] b,
int off,
int len)
Writes to ChannelWriter
|
void |
write(byte[] source,
int sourceOff,
int sourceLen,
int sourceMask)
Writes byte[] to ChannelWriter
|
static <T extends MessageSchema<T>> |
write(DataOutputBlobWriter<T> writer,
byte[] source,
int sourceOff,
int sourceLen) |
static <T extends MessageSchema<T>> |
write(DataOutputBlobWriter<T> writer,
byte[] source,
int sourceOff,
int sourceLen,
int sourceMask) |
void |
write(Externalizable object)
Writes data from object to ChannelWriter
|
void |
write(int b) |
static int |
write16(byte[] buf,
int mask,
int pos,
int v) |
static int |
write32(byte[] buf,
int mask,
int pos,
int v) |
static int |
write64(byte[] buf,
int mask,
int pos,
long v) |
void |
writeASCII(CharSequence s)
Writes CharSequence to ChannelWriter
|
void |
writeBoolean(boolean v)
Writes boolean to ChannelWriter
|
void |
writeBooleanArray(boolean[] booleans)
Deprecated.
|
void |
writeBooleanNull()
Writes null boolean to ChannelWriter
|
void |
writeByte(int v)
The low 8 bits are written to ChannelWriter
|
void |
writeByteArray(byte[] bytes)
Deprecated.
|
static <T extends MessageSchema<T>> |
writeBytes(DataOutputBlobWriter<T> writer,
byte pattern,
int runLength) |
static <T extends MessageSchema<T>> |
writeBytes(DataOutputBlobWriter<T> writer,
DataInputBlobReader<RawDataSchema> reader,
int length) |
void |
writeBytes(String s) |
void |
writeChar(int v) |
void |
writeCharArray(char[] chars)
Deprecated.
|
void |
writeChars(String s) |
void |
writeDecimal(long m,
byte e)
Writes long and byte to ChannelWriter
|
void |
writeDouble(double v)
Writes double to ChannelWriter
|
void |
writeDoubleArray(double[] doubles)
Deprecated.
|
void |
writeFloat(float v)
Writes float to ChannelWriter
|
void |
writeFloatArray(float[] floats)
Deprecated.
|
void |
writeInt(int v)
Writes int to ChannelWriter
|
void |
writeIntArray(int[] ints)
Deprecated.
|
void |
writeLong(long v)
Writes long to ChannelWriter
|
void |
writeLongArray(long[] longs)
Deprecated.
|
void |
writeObject(Object object)
Writes object to ChannelWriter
|
static <T extends MessageSchema<T>> |
writePackedChars(DataOutputBlobWriter<T> that,
byte[] source,
int sourceMask,
int sourceLength,
int sourcePos) |
static <T extends MessageSchema<T>> |
writePackedChars(DataOutputBlobWriter<T> that,
CharSequence s) |
static <T extends MessageSchema<T>> |
writePackedInt(DataOutputBlobWriter<T> that,
int value) |
void |
writePackedInt(int value)
Writes packed int to ChannelWriter
|
static <T extends MessageSchema<T>> |
writePackedLong(DataOutputBlobWriter<T> that,
long value) |
void |
writePackedLong(long value)
Writes packed long to ChannelWriter
|
static int |
writePackedLong(long value,
byte[] byteBuffer,
int byteMask,
int position) |
void |
writePackedNull()
Writes packedNull to ChannelWriter
|
static <T extends MessageSchema<T>> |
writePackedNull(DataOutputBlobWriter<T> that) |
static <T extends MessageSchema<T>> |
writePackedShort(DataOutputBlobWriter<T> that,
short value) |
void |
writePackedShort(short value)
Writes packed short to ChannelWriter
|
void |
writePackedString(CharSequence text)
Writes packed CharSequence to ChannelWriter
|
static <T extends MessageSchema<T>> |
writePackedUInt(DataOutputBlobWriter<T> that,
int value) |
static <T extends MessageSchema<T>> |
writePackedULong(DataOutputBlobWriter<T> that,
long value) |
static <T extends MessageSchema<T>> |
writePackedUShort(DataOutputBlobWriter<T> that,
short value) |
void |
writeRational(long numerator,
long denominator)
Writes longs to ChannelWriter
|
void |
writeShort(int v)
The low 16 bits are written to ChannelWriter
|
void |
writeShortArray(short[] shorts)
Deprecated.
|
void |
writeStream(DataInputBlobReader<S> input,
int length) |
static <T extends MessageSchema<T>,S extends MessageSchema<S>> |
writeStream(DataOutputBlobWriter<T> that,
DataInputBlobReader<S> input,
int length) |
static <T extends MessageSchema<T>> |
writeToEndFrom(DataOutputBlobWriter<T> writer,
int sizeInBytes,
DataInputBlobReader<RawDataSchema> reader) |
void |
writeUTF(CharSequence s)
Writes CharSequence to ChannelWriter
|
void |
writeUTF(String s)
Writes specified string to ChannelWriter
|
void |
writeUTF8Text(CharSequence s)
Writes CharSequence to ChannelWriter
|
void |
writeUTF8Text(CharSequence s,
int pos,
int len)
Writes UTF8 to ChannelWriter
|
void |
writeUTFArray(String[] utfs)
Writes array of UTFs to ChannelWriter
|
close, flushclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitclose, flushprotected final Pipe<S extends MessageSchema<S>> backingPipe
public void openField()
public boolean reportObjectSizes(Appendable target)
ChannelWriterreportObjectSizes in class ChannelWriterprotected static <T extends MessageSchema<T>> void checkLimit(DataOutputBlobWriter<T> that, int x)
that - x - public static <T extends MessageSchema<T>> DataOutputBlobWriter<T> openField(DataOutputBlobWriter<T> writer)
public static <T extends MessageSchema<T>> DataOutputBlobWriter<T> openFieldAtPosition(DataOutputBlobWriter<T> writer, int workingBlobHeadPosition)
public int position()
ChannelWriterposition in class ChannelWriterpublic int remaining()
ChannelWriterremaining in class ChannelWriterpublic void debug()
public void debugAsUTF8()
public void debugAsUTF8(Appendable target)
public void replicate(DataOutputBlobWriter<?> writer)
writer - public void replicate(Appendable target)
public static <T extends MessageSchema<T>> boolean tryClearIntBackData(DataOutputBlobWriter<T> writer, int intCount)
public static <T extends MessageSchema<T>> int lastBackPositionOfIndex(DataOutputBlobWriter<T> writer)
public static <T extends MessageSchema<T>> boolean structTypeValidation(DataOutputBlobWriter<T> writer, int value)
public static <T extends MessageSchema<T>> int getStructType(DataOutputBlobWriter<T> writer)
public static <T extends MessageSchema<T>> void setStructType(DataOutputBlobWriter<T> writer, int value)
public static <T extends MessageSchema<T>> void setIntBackData(DataOutputBlobWriter<T> writer, int value, int pos)
public static <T extends MessageSchema<T>> void writeToEndFrom(DataOutputBlobWriter<T> writer, int sizeInBytes, DataInputBlobReader<RawDataSchema> reader)
public int closeHighLevelField(int targetFieldLoc)
ChannelWritercloseHighLevelField in class ChannelWritertargetFieldLoc - location of field to closepublic static <T extends MessageSchema<T>> int closeHighLevelField(DataOutputBlobWriter<T> writer, int targetFieldLoc)
public int closeLowLevelField()
ChannelWritercloseLowLevelField in class ChannelWriterpublic static <T extends MessageSchema<T>> int closeLowLevelField(DataOutputBlobWriter<T> writer)
writer - public static <T extends MessageSchema<T>> int closeLowLevelMaxVarLenField(DataOutputBlobWriter<T> writer)
writer - public static <T extends MessageSchema<T>> void commitBackData(DataOutputBlobWriter<T> writer, int structId)
public static <T extends MessageSchema<T>> int closeLowLeveLField(DataOutputBlobWriter<T> writer, int len)
public int length()
ChannelWriterlength in class ChannelWriterpublic int absolutePosition()
absolutePosition in class ChannelWriterpublic void absolutePosition(int absolutePosition)
absolutePosition in class ChannelWriterabsolutePosition - the actual offset position in the array where you want to be right nowpublic static <T extends MessageSchema<T>> int length(DataOutputBlobWriter<T> writer)
public byte[] toByteArray()
ChannelWritertoByteArray in class ChannelWriterpublic void write(Externalizable object)
ChannelWriterwrite in class ChannelWriterobject - object to get data frompublic void writeObject(Object object)
ChannelWriterwriteObject in interface ObjectOutputwriteObject in class ChannelWriterobject - object to be writtenpublic void write(int b)
write in interface DataOutputwrite in interface ObjectOutputwrite in class OutputStreampublic void write(byte[] b)
ChannelWriterwrite in interface ByteWriterwrite in interface DataOutputwrite in interface ObjectOutputwrite in class ChannelWriterb - byte array to be writtenpublic void write(byte[] b,
int off,
int len)
ChannelWriterwrite in interface ByteWriterwrite in interface DataOutputwrite in interface ObjectOutputwrite in class ChannelWriterb - byte[] to be writtenoff - int offset of were to write byte[]len - length of byte arraypublic void writeBoolean(boolean v)
ChannelWriterwriteBoolean in interface DataOutputwriteBoolean in class ChannelWriterv - boolean to be writtenpublic void writeBooleanNull()
ChannelWriterwriteBooleanNull in class ChannelWriterpublic void writeByte(int v)
ChannelWriterwriteByte in interface ByteWriterwriteByte in interface DataOutputwriteByte in class ChannelWriterv - int to be converted to byte and writtenpublic void writeShort(int v)
ChannelWriterwriteShort in interface DataOutputwriteShort in class ChannelWriterv - int to be converted to short and writtenpublic void writeChar(int v)
public void writeInt(int v)
ChannelWriterwriteInt in interface DataOutputwriteInt in class ChannelWriterv - int to be writtenpublic void writeLong(long v)
ChannelWriterwriteLong in interface DataOutputwriteLong in class ChannelWriterv - long to be writtenpublic void writeFloat(float v)
ChannelWriterwriteFloat in interface DataOutputwriteFloat in class ChannelWriterv - float to be writtenpublic void writeDouble(double v)
ChannelWriterwriteDouble in interface DataOutputwriteDouble in class ChannelWriterv - double to be writtenpublic void writeBytes(String s)
public void writeChars(String s)
public void writeUTF(String s)
ChannelWriterwriteUTF in interface DataOutputwriteUTF in class ChannelWriters - UTF to be writtenpublic void writeUTF8Text(CharSequence s)
ChannelWriterwriteUTF8Text in class ChannelWriters - UTF8 text to be writtenpublic void writeUTF8Text(CharSequence s, int pos, int len)
ChannelWriterwriteUTF8Text in class ChannelWriters - CharSequence to be writtenpos - position to write UTFlen - length of CharSequencepublic static <T extends MessageSchema<T>> void encodeAsUTF8(DataOutputBlobWriter<T> writer, CharSequence s)
public static <T extends MessageSchema<T>> void encodeAsUTF8(DataOutputBlobWriter<T> writer, CharSequence s, int position, int length)
public static <T extends MessageSchema<T>> int encodeAsUTF8(DataOutputBlobWriter<T> writer, CharSequence s, int sPos, int sLen, int mask, byte[] localBuf, int pos)
public void writeStream(DataInputBlobReader<S> input, int length)
public static <T extends MessageSchema<T>,S extends MessageSchema<S>> void writeStream(DataOutputBlobWriter<T> that, DataInputBlobReader<S> input, int length)
public static int write16(byte[] buf,
int mask,
int pos,
int v)
public static int write32(byte[] buf,
int mask,
int pos,
int v)
public static int write64(byte[] buf,
int mask,
int pos,
long v)
public void writeUTF(CharSequence s)
ChannelWriterwriteUTF in class ChannelWriters - UTF text to be writtenpublic void writeASCII(CharSequence s)
ChannelWriterwriteASCII in class ChannelWriters - ASCII to be writtenpublic void consume(byte[] backing,
int pos,
int len,
int mask)
public void consume(byte value)
@Deprecated public void writeByteArray(byte[] bytes)
@Deprecated public void writeCharArray(char[] chars)
@Deprecated public void writeIntArray(int[] ints)
@Deprecated public void writeLongArray(long[] longs)
@Deprecated public void writeDoubleArray(double[] doubles)
@Deprecated public void writeFloatArray(float[] floats)
@Deprecated public void writeShortArray(short[] shorts)
@Deprecated public void writeBooleanArray(boolean[] booleans)
public void writeUTFArray(String[] utfs)
ChannelWriterwriteUTFArray in class ChannelWriterutfs - string to be writtenpublic void write(byte[] source,
int sourceOff,
int sourceLen,
int sourceMask)
ChannelWriterwrite in class ChannelWritersource - source of byte arraysourceOff - source offset of where to write tosourceLen - length of byte arraysourceMask - mask required for looping around backing arraypublic static <T extends MessageSchema<T>> void write(DataOutputBlobWriter<T> writer, byte[] source, int sourceOff, int sourceLen, int sourceMask)
public static <T extends MessageSchema<T>> void write(DataOutputBlobWriter<T> writer, byte[] source, int sourceOff, int sourceLen)
public static <T extends MessageSchema<T>> void writeBytes(DataOutputBlobWriter<T> writer, byte pattern, int runLength)
public static <T extends MessageSchema<T>> int writeBytes(DataOutputBlobWriter<T> writer, DataInputBlobReader<RawDataSchema> reader, int length)
public final void writePackedString(CharSequence text)
ChannelWriterwritePackedString in class ChannelWritertext - text to be writtenpublic static <T extends MessageSchema<T>> void writePackedChars(DataOutputBlobWriter<T> that, CharSequence s)
public static <T extends MessageSchema<T>> void writePackedChars(DataOutputBlobWriter<T> that, byte[] source, int sourceMask, int sourceLength, int sourcePos)
public final void writePackedLong(long value)
ChannelWriterwritePackedLong in class ChannelWritervalue - long to be writtenpublic final void writePackedNull()
ChannelWriterwritePackedNull in class ChannelWriterpublic final void writePackedInt(int value)
ChannelWriterwritePackedInt in class ChannelWritervalue - int to be writtenpublic final void writePackedShort(short value)
ChannelWriterwritePackedShort in class ChannelWritervalue - short to be writtenpublic static final <T extends MessageSchema<T>> void writePackedNull(DataOutputBlobWriter<T> that)
public static final <T extends MessageSchema<T>> void writePackedLong(DataOutputBlobWriter<T> that, long value)
public static int writePackedLong(long value,
byte[] byteBuffer,
int byteMask,
int position)
public static final <T extends MessageSchema<T>> void writePackedInt(DataOutputBlobWriter<T> that, int value)
public static final <T extends MessageSchema<T>> void writePackedShort(DataOutputBlobWriter<T> that, short value)
public static final <T extends MessageSchema<T>> void writePackedULong(DataOutputBlobWriter<T> that, long value)
public static final <T extends MessageSchema<T>> void writePackedUInt(DataOutputBlobWriter<T> that, int value)
public static final <T extends MessageSchema<T>> void writePackedUShort(DataOutputBlobWriter<T> that, short value)
public ChannelWriter append(CharSequence s)
public ChannelWriter append(CharSequence csq, int start, int end)
public ChannelWriter append(char c)
public void writeRational(long numerator,
long denominator)
ChannelWriterwriteRational in class ChannelWriternumerator - long to be writtendenominator - long to be writtenpublic static void copyBackData(DataOutputBlobWriter that, byte[] backing, int start, int copyLen, int byteMask2)
public long startsWith(TrieParserReader reader, TrieParser tp)
public StructuredWriter structured()
structured in class ChannelWriterpublic void writeDecimal(long m,
byte e)
ChannelWriterwriteDecimal in class ChannelWriterm - long to be writtene - byte to be writtenpublic void reset()
ByteWriterCopyright © 2018. All Rights Reserved.