Package org.infinispan.protostream.impl
Class TagWriterImpl
- java.lang.Object
-
- org.infinispan.protostream.impl.TagWriterImpl
-
- All Implemented Interfaces:
ProtobufTagMarshaller.OperationContext
,ProtobufTagMarshaller.WriteContext
,RawProtoStreamWriter
,TagWriter
public final class TagWriterImpl extends Object implements TagWriter, ProtobufTagMarshaller.WriteContext
- Since:
- 3.0
- Author:
- [email protected]
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
flush()
Object
getParam(Object key)
org.infinispan.protostream.impl.ProtoStreamWriterImpl
getProtoStreamWriter()
Deprecated.this will be removed in 5.0 together withMessageMarshaller
SerializationContextImpl
getSerializationContext()
Provides access to theImmutableSerializationContext
.TagWriter
getWriter()
int
getWrittenBytes()
static TagWriterImpl
newInstance(ImmutableSerializationContext serCtx)
static TagWriterImpl
newInstance(ImmutableSerializationContext serCtx, byte[] buf)
static TagWriterImpl
newInstance(ImmutableSerializationContext serCtx, byte[] buf, int offset, int length)
static TagWriterImpl
newInstance(ImmutableSerializationContext serCtx, OutputStream output)
static TagWriterImpl
newInstance(ImmutableSerializationContext serCtx, OutputStream output, int bufferSize)
static TagWriterImpl
newInstance(ImmutableSerializationContext serCtx, ByteBuffer byteBuffer)
static TagWriterImpl
newInstanceNoBuffer(ImmutableSerializationContext ctx, OutputStream out)
static TagWriterImpl
newNestedInstance(ProtobufTagMarshaller.WriteContext parent, byte[] buf)
static TagWriterImpl
newNestedInstance(ProtobufTagMarshaller.WriteContext parent, OutputStream output)
void
setParam(Object key, Object value)
void
writeBool(int number, boolean value)
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.void
writeDouble(int number, double value)
void
writeEnum(int number, int value)
void
writeFixed32(int number, int value)
void
writeFixed64(int number, long value)
void
writeFloat(int number, float value)
void
writeInt32(int number, int value)
void
writeInt64(int number, long value)
void
writeRawByte(byte value)
void
writeRawBytes(byte[] value, int offset, int length)
void
writeRawBytes(ByteBuffer value)
Write all remaining bytes from current buffer position.void
writeSFixed32(int number, int value)
void
writeSFixed64(int number, long value)
void
writeSInt32(int number, int value)
void
writeSInt64(int number, long value)
void
writeString(int number, String value)
void
writeTag(int number, int wireType)
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 class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.infinispan.protostream.RawProtoStreamWriter
writeUInt32NoTag, writeUInt64NoTag
-
-
-
-
Method Detail
-
newNestedInstance
public static TagWriterImpl newNestedInstance(ProtobufTagMarshaller.WriteContext parent, OutputStream output)
-
newNestedInstance
public static TagWriterImpl newNestedInstance(ProtobufTagMarshaller.WriteContext parent, byte[] buf)
-
newInstance
public static TagWriterImpl newInstance(ImmutableSerializationContext serCtx, OutputStream output)
-
newInstance
public static TagWriterImpl newInstance(ImmutableSerializationContext serCtx, OutputStream output, int bufferSize)
-
newInstance
public static TagWriterImpl newInstance(ImmutableSerializationContext serCtx, byte[] buf)
-
newInstance
public static TagWriterImpl newInstance(ImmutableSerializationContext serCtx, byte[] buf, int offset, int length)
-
newInstance
public static TagWriterImpl newInstance(ImmutableSerializationContext serCtx, ByteBuffer byteBuffer)
-
newInstance
public static TagWriterImpl newInstance(ImmutableSerializationContext serCtx)
-
newInstanceNoBuffer
public static TagWriterImpl newInstanceNoBuffer(ImmutableSerializationContext ctx, OutputStream out)
-
getWrittenBytes
public int getWrittenBytes()
-
flush
public void flush() throws IOException
- Specified by:
flush
in interfaceRawProtoStreamWriter
- Specified by:
flush
in interfaceTagWriter
- Throws:
IOException
-
writeTag
public void writeTag(int number, int wireType) throws IOException
- Specified by:
writeTag
in interfaceRawProtoStreamWriter
- Specified by:
writeTag
in interfaceTagWriter
- Throws:
IOException
-
writeTag
public void writeTag(int number, WireType wireType) throws IOException
- Specified by:
writeTag
in interfaceRawProtoStreamWriter
- Specified by:
writeTag
in interfaceTagWriter
- Throws:
IOException
-
writeVarint32
public void writeVarint32(int value) throws IOException
- Specified by:
writeVarint32
in interfaceRawProtoStreamWriter
- Specified by:
writeVarint32
in interfaceTagWriter
- Throws:
IOException
-
writeVarint64
public void writeVarint64(long value) throws IOException
- Specified by:
writeVarint64
in interfaceRawProtoStreamWriter
- Specified by:
writeVarint64
in interfaceTagWriter
- Throws:
IOException
-
writeString
public void writeString(int number, String value) throws IOException
- Specified by:
writeString
in interfaceRawProtoStreamWriter
- Specified by:
writeString
in interfaceTagWriter
- Throws:
IOException
-
writeInt32
public void writeInt32(int number, int value) throws IOException
- Specified by:
writeInt32
in interfaceRawProtoStreamWriter
- Specified by:
writeInt32
in interfaceTagWriter
- Throws:
IOException
-
writeUInt32
public void writeUInt32(int number, int value) throws IOException
- Specified by:
writeUInt32
in interfaceRawProtoStreamWriter
- Specified by:
writeUInt32
in interfaceTagWriter
- Throws:
IOException
-
writeSInt32
public void writeSInt32(int number, int value) throws IOException
- Specified by:
writeSInt32
in interfaceRawProtoStreamWriter
- Specified by:
writeSInt32
in interfaceTagWriter
- Throws:
IOException
-
writeFixed32
public void writeFixed32(int number, int value) throws IOException
- Specified by:
writeFixed32
in interfaceRawProtoStreamWriter
- Specified by:
writeFixed32
in interfaceTagWriter
- Throws:
IOException
-
writeSFixed32
public void writeSFixed32(int number, int value) throws IOException
- Specified by:
writeSFixed32
in interfaceRawProtoStreamWriter
- Specified by:
writeSFixed32
in interfaceTagWriter
- Throws:
IOException
-
writeInt64
public void writeInt64(int number, long value) throws IOException
- Specified by:
writeInt64
in interfaceRawProtoStreamWriter
- Specified by:
writeInt64
in interfaceTagWriter
- Throws:
IOException
-
writeUInt64
public void writeUInt64(int number, long value) throws IOException
- Specified by:
writeUInt64
in interfaceRawProtoStreamWriter
- Specified by:
writeUInt64
in interfaceTagWriter
- Throws:
IOException
-
writeSInt64
public void writeSInt64(int number, long value) throws IOException
- Specified by:
writeSInt64
in interfaceRawProtoStreamWriter
- Specified by:
writeSInt64
in interfaceTagWriter
- Throws:
IOException
-
writeFixed64
public void writeFixed64(int number, long value) throws IOException
- Specified by:
writeFixed64
in interfaceRawProtoStreamWriter
- Specified by:
writeFixed64
in interfaceTagWriter
- Throws:
IOException
-
writeSFixed64
public void writeSFixed64(int number, long value) throws IOException
- Specified by:
writeSFixed64
in interfaceRawProtoStreamWriter
- Specified by:
writeSFixed64
in interfaceTagWriter
- Throws:
IOException
-
writeEnum
public void writeEnum(int number, int value) throws IOException
- Specified by:
writeEnum
in interfaceRawProtoStreamWriter
- Specified by:
writeEnum
in interfaceTagWriter
- Throws:
IOException
-
writeBool
public void writeBool(int number, boolean value) throws IOException
- Specified by:
writeBool
in interfaceRawProtoStreamWriter
- Specified by:
writeBool
in interfaceTagWriter
- Throws:
IOException
-
writeDouble
public void writeDouble(int number, double value) throws IOException
- Specified by:
writeDouble
in interfaceRawProtoStreamWriter
- Specified by:
writeDouble
in interfaceTagWriter
- Throws:
IOException
-
writeFloat
public void writeFloat(int number, float value) throws IOException
- Specified by:
writeFloat
in interfaceRawProtoStreamWriter
- Specified by:
writeFloat
in interfaceTagWriter
- Throws:
IOException
-
writeBytes
public 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
- Specified by:
writeBytes
in interfaceTagWriter
- Throws:
IOException
-
writeBytes
public void writeBytes(int number, byte[] value) throws IOException
- Specified by:
writeBytes
in interfaceRawProtoStreamWriter
- Specified by:
writeBytes
in interfaceTagWriter
- Throws:
IOException
-
writeBytes
public void writeBytes(int number, byte[] value, int offset, int length) throws IOException
- Specified by:
writeBytes
in interfaceRawProtoStreamWriter
- Specified by:
writeBytes
in interfaceTagWriter
- Throws:
IOException
-
writeRawByte
public void writeRawByte(byte value) throws IOException
- Specified by:
writeRawByte
in interfaceRawProtoStreamWriter
- Throws:
IOException
-
writeRawBytes
public void writeRawBytes(byte[] value, int offset, int length) throws IOException
- Specified by:
writeRawBytes
in interfaceRawProtoStreamWriter
- Specified by:
writeRawBytes
in interfaceTagWriter
- Throws:
IOException
-
writeRawBytes
public void writeRawBytes(ByteBuffer value) throws IOException
Description copied from interface:RawProtoStreamWriter
Write all remaining bytes from current buffer position.- Specified by:
writeRawBytes
in interfaceRawProtoStreamWriter
- Throws:
IOException
-
getSerializationContext
public SerializationContextImpl getSerializationContext()
Description copied from interface:ProtobufTagMarshaller.OperationContext
Provides access to theImmutableSerializationContext
.- Specified by:
getSerializationContext
in interfaceProtobufTagMarshaller.OperationContext
-
getParam
public Object getParam(Object key)
- Specified by:
getParam
in interfaceProtobufTagMarshaller.OperationContext
-
setParam
public void setParam(Object key, Object value)
- Specified by:
setParam
in interfaceProtobufTagMarshaller.OperationContext
-
getWriter
public TagWriter getWriter()
- Specified by:
getWriter
in interfaceProtobufTagMarshaller.WriteContext
-
getProtoStreamWriter
@Deprecated public org.infinispan.protostream.impl.ProtoStreamWriterImpl getProtoStreamWriter()
Deprecated.this will be removed in 5.0 together withMessageMarshaller
-
-