Package org.infinispan.protostream
Interface TagWriter
-
- All Superinterfaces:
AutoCloseable
,Closeable
,RawProtoStreamWriter
- All Known Implementing Classes:
TagWriterImpl
public interface TagWriter extends RawProtoStreamWriter, Closeable
- Since:
- 4.4
- Author:
- [email protected]
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description void
close()
Invoke after done with writer, this implies a flush if necessary It is necessary to invoke this on a writer returned fromsubWriter(int, boolean)
to actually push the datavoid
flush()
ProtobufTagMarshaller.WriteContext
subWriter(int number, boolean nested)
Used to write a sub message that can be optimized by implementation.void
writeBool(int number, boolean value)
default void
writeBytes(int number, byte[] value)
void
writeBytes(int number, byte[] value, int offset, int length)
void
writeBytes(int number, ByteBuffer value)
Write field tag and all remaining bytes from current buffer position.default void
writeDouble(int number, double value)
default void
writeEnum(int number, int value)
void
writeFixed32(int number, int value)
void
writeFixed64(int number, long value)
default void
writeFloat(int number, float value)
default void
writeInt32(int number, int value)
void
writeInt64(int number, long value)
void
writeRawBytes(byte[] value, int offset, int length)
default void
writeSFixed32(int number, int value)
default void
writeSFixed64(int number, long value)
default void
writeSInt32(int number, int value)
default void
writeSInt64(int number, long value)
void
writeString(int number, String value)
default void
writeTag(int number, int wireType)
default void
writeTag(int number, WireType wireType)
void
writeUInt32(int number, int value)
void
writeUInt64(int number, long value)
void
writeVarint32(int value)
void
writeVarint64(long value)
-
Methods inherited from interface org.infinispan.protostream.RawProtoStreamWriter
writeRawByte, writeRawBytes, writeUInt32NoTag, writeUInt64NoTag
-
-
-
-
Method Detail
-
flush
void flush() throws IOException
- Specified by:
flush
in interfaceRawProtoStreamWriter
- Throws:
IOException
-
close
void close() throws IOException
Invoke after done with writer, this implies a flush if necessary It is necessary to invoke this on a writer returned fromsubWriter(int, boolean)
to actually push the data- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Throws:
IOException
-
writeTag
default void writeTag(int number, int wireType) throws IOException
- Specified by:
writeTag
in interfaceRawProtoStreamWriter
- Throws:
IOException
-
writeTag
default void writeTag(int number, WireType wireType) throws IOException
- Specified by:
writeTag
in interfaceRawProtoStreamWriter
- Throws:
IOException
-
writeVarint32
void writeVarint32(int value) throws IOException
- Specified by:
writeVarint32
in interfaceRawProtoStreamWriter
- Throws:
IOException
-
writeVarint64
void writeVarint64(long value) throws IOException
- Specified by:
writeVarint64
in interfaceRawProtoStreamWriter
- Throws:
IOException
-
writeRawBytes
void writeRawBytes(byte[] value, int offset, int length) throws IOException
- Specified by:
writeRawBytes
in interfaceRawProtoStreamWriter
- Throws:
IOException
-
writeString
void writeString(int number, String value) throws IOException
- Specified by:
writeString
in interfaceRawProtoStreamWriter
- Throws:
IOException
-
writeInt32
default void writeInt32(int number, int value) throws IOException
- Specified by:
writeInt32
in interfaceRawProtoStreamWriter
- Throws:
IOException
-
writeUInt32
void writeUInt32(int number, int value) throws IOException
- Specified by:
writeUInt32
in interfaceRawProtoStreamWriter
- Throws:
IOException
-
writeSInt32
default void writeSInt32(int number, int value) throws IOException
- Specified by:
writeSInt32
in interfaceRawProtoStreamWriter
- Throws:
IOException
-
writeFixed32
void writeFixed32(int number, int value) throws IOException
- Specified by:
writeFixed32
in interfaceRawProtoStreamWriter
- Throws:
IOException
-
writeSFixed32
default void writeSFixed32(int number, int value) throws IOException
- Specified by:
writeSFixed32
in interfaceRawProtoStreamWriter
- Throws:
IOException
-
writeInt64
void writeInt64(int number, long value) throws IOException
- Specified by:
writeInt64
in interfaceRawProtoStreamWriter
- Throws:
IOException
-
writeUInt64
void writeUInt64(int number, long value) throws IOException
- Specified by:
writeUInt64
in interfaceRawProtoStreamWriter
- Throws:
IOException
-
writeSInt64
default void writeSInt64(int number, long value) throws IOException
- Specified by:
writeSInt64
in interfaceRawProtoStreamWriter
- Throws:
IOException
-
writeFixed64
void writeFixed64(int number, long value) throws IOException
- Specified by:
writeFixed64
in interfaceRawProtoStreamWriter
- Throws:
IOException
-
writeSFixed64
default void writeSFixed64(int number, long value) throws IOException
- Specified by:
writeSFixed64
in interfaceRawProtoStreamWriter
- Throws:
IOException
-
writeEnum
default void writeEnum(int number, int value) throws IOException
- Specified by:
writeEnum
in interfaceRawProtoStreamWriter
- Throws:
IOException
-
writeBool
void writeBool(int number, boolean value) throws IOException
- Specified by:
writeBool
in interfaceRawProtoStreamWriter
- Throws:
IOException
-
writeDouble
default void writeDouble(int number, double value) throws IOException
- Specified by:
writeDouble
in interfaceRawProtoStreamWriter
- Throws:
IOException
-
writeFloat
default void writeFloat(int number, float value) throws IOException
- Specified by:
writeFloat
in interfaceRawProtoStreamWriter
- Throws:
IOException
-
writeBytes
void writeBytes(int number, ByteBuffer value) throws IOException
Description copied from interface:RawProtoStreamWriter
Write field tag and all remaining bytes from current buffer position.- Specified by:
writeBytes
in interfaceRawProtoStreamWriter
- Throws:
IOException
-
writeBytes
default void writeBytes(int number, byte[] value) throws IOException
- Specified by:
writeBytes
in interfaceRawProtoStreamWriter
- Throws:
IOException
-
writeBytes
void writeBytes(int number, byte[] value, int offset, int length) throws IOException
- Specified by:
writeBytes
in interfaceRawProtoStreamWriter
- Throws:
IOException
-
subWriter
ProtobufTagMarshaller.WriteContext subWriter(int number, boolean nested) throws IOException
Used to write a sub message that can be optimized by implementation. When the sub writer is complete, flush should be invoked to ensure bytes are written and close should be invoked to free any resources related to the context (note close will flush as well)- Parameters:
number
- the message number of the sub messagenested
- whether this is a nested message or a new one- Returns:
- a write context for a sub message
- Throws:
IOException
- exception if there is an issue
-
-