Class AbstractProtoStreamWriter

java.lang.Object
org.wildfly.clustering.marshalling.protostream.AbstractProtoStreamOperation
org.wildfly.clustering.marshalling.protostream.AbstractProtoStreamWriter
All Implemented Interfaces:
AutoCloseable, org.infinispan.protostream.ProtobufTagMarshaller.OperationContext, org.infinispan.protostream.ProtobufTagMarshaller.WriteContext, org.infinispan.protostream.TagWriter, ProtoStreamOperation, ProtoStreamWriter
Direct Known Subclasses:
DefaultProtoStreamWriter, SizeComputingProtoStreamWriter

public abstract class AbstractProtoStreamWriter extends AbstractProtoStreamOperation implements ProtoStreamWriter, org.infinispan.protostream.ProtobufTagMarshaller.WriteContext
Delegates most ProtoStreamWriter operations to a TagWriter.
Author:
Paul Ferraro
  • Method Details

    • getContext

      public ProtoStreamOperation.Context getContext()
      Description copied from interface: ProtoStreamOperation
      Returns the context of this operation
      Specified by:
      getContext in interface ProtoStreamOperation
      Returns:
      the operation context
    • getWriter

      public org.infinispan.protostream.TagWriter getWriter()
      Specified by:
      getWriter in interface org.infinispan.protostream.ProtobufTagMarshaller.WriteContext
    • depth

      public int depth()
      Specified by:
      depth in interface org.infinispan.protostream.ProtobufTagMarshaller.WriteContext
    • createFieldSetWriter

      public <T> FieldSetWriter<T> createFieldSetWriter(Writable<T> writer, int startIndex)
      Description copied from interface: ProtoStreamWriter
      Creates a writer for a set of consecutive fields.
      Specified by:
      createFieldSetWriter in interface ProtoStreamWriter
      Type Parameters:
      T - the type encapsulated by this field set
      Parameters:
      writer - the marshaller used to write the set of fields
      startIndex - the starting index of this field set
      Returns:
      a writer for a set of consecutive fields.
    • writeAnyNoTag

      public void writeAnyNoTag(Object value) throws IOException
      Description copied from interface: ProtoStreamWriter
      Writes the specified object of an arbitrary type. Must be preceded by {TagWriter.writeTag(int, org.infinispan.protostream.descriptors.WireType).
      Specified by:
      writeAnyNoTag in interface ProtoStreamWriter
      Parameters:
      value - a value to be written
      Throws:
      IOException - if no marshaller is associated with the type of the specified object, or if the marshaller fails to write the specified object
    • writeTag

      public void writeTag(int number, org.infinispan.protostream.descriptors.WireType wireType) throws IOException
      Specified by:
      writeTag in interface org.infinispan.protostream.TagWriter
      Throws:
      IOException
    • writeVarint32

      public void writeVarint32(int value) throws IOException
      Specified by:
      writeVarint32 in interface org.infinispan.protostream.TagWriter
      Throws:
      IOException
    • writeVarint64

      public void writeVarint64(long value) throws IOException
      Specified by:
      writeVarint64 in interface org.infinispan.protostream.TagWriter
      Throws:
      IOException
    • writeRawBytes

      public void writeRawBytes(byte[] value, int offset, int length) throws IOException
      Specified by:
      writeRawBytes in interface org.infinispan.protostream.TagWriter
      Throws:
      IOException
    • writeBool

      public void writeBool(int index, boolean value) throws IOException
      Specified by:
      writeBool in interface org.infinispan.protostream.TagWriter
      Throws:
      IOException
    • writeEnum

      public void writeEnum(int index, int value) throws IOException
      Specified by:
      writeEnum in interface org.infinispan.protostream.TagWriter
      Throws:
      IOException
    • writeInt32

      @Deprecated public void writeInt32(int index, int value) throws IOException
      Deprecated.
      Description copied from interface: ProtoStreamWriter
      Deprecated to discourage use.
      Specified by:
      writeInt32 in interface ProtoStreamWriter
      Specified by:
      writeInt32 in interface org.infinispan.protostream.TagWriter
      Throws:
      IOException
    • writeFixed32

      @Deprecated public void writeFixed32(int index, int value) throws IOException
      Deprecated.
      Description copied from interface: ProtoStreamWriter
      Deprecated to discourage use.
      Specified by:
      writeFixed32 in interface ProtoStreamWriter
      Specified by:
      writeFixed32 in interface org.infinispan.protostream.TagWriter
      Throws:
      IOException
    • writeUInt32

      public void writeUInt32(int index, int value) throws IOException
      Specified by:
      writeUInt32 in interface org.infinispan.protostream.TagWriter
      Throws:
      IOException
    • writeSInt32

      public void writeSInt32(int index, int value) throws IOException
      Specified by:
      writeSInt32 in interface org.infinispan.protostream.TagWriter
      Throws:
      IOException
    • writeSFixed32

      public void writeSFixed32(int index, int value) throws IOException
      Specified by:
      writeSFixed32 in interface org.infinispan.protostream.TagWriter
      Throws:
      IOException
    • writeInt64

      @Deprecated public void writeInt64(int index, long value) throws IOException
      Deprecated.
      Description copied from interface: ProtoStreamWriter
      Deprecated to discourage use.
      Specified by:
      writeInt64 in interface ProtoStreamWriter
      Specified by:
      writeInt64 in interface org.infinispan.protostream.TagWriter
      Throws:
      IOException
    • writeFixed64

      @Deprecated public void writeFixed64(int index, long value) throws IOException
      Deprecated.
      Description copied from interface: ProtoStreamWriter
      Deprecated to discourage use.
      Specified by:
      writeFixed64 in interface ProtoStreamWriter
      Specified by:
      writeFixed64 in interface org.infinispan.protostream.TagWriter
      Throws:
      IOException
    • writeUInt64

      public void writeUInt64(int index, long value) throws IOException
      Specified by:
      writeUInt64 in interface org.infinispan.protostream.TagWriter
      Throws:
      IOException
    • writeSInt64

      public void writeSInt64(int index, long value) throws IOException
      Specified by:
      writeSInt64 in interface org.infinispan.protostream.TagWriter
      Throws:
      IOException
    • writeSFixed64

      public void writeSFixed64(int index, long value) throws IOException
      Specified by:
      writeSFixed64 in interface org.infinispan.protostream.TagWriter
      Throws:
      IOException
    • writeFloat

      public void writeFloat(int index, float value) throws IOException
      Specified by:
      writeFloat in interface org.infinispan.protostream.TagWriter
      Throws:
      IOException
    • writeDouble

      public void writeDouble(int index, double value) throws IOException
      Specified by:
      writeDouble in interface org.infinispan.protostream.TagWriter
      Throws:
      IOException
    • writeBytes

      public void writeBytes(int index, byte[] value) throws IOException
      Specified by:
      writeBytes in interface org.infinispan.protostream.TagWriter
      Throws:
      IOException
    • writeBytes

      public void writeBytes(int index, byte[] value, int offset, int length) throws IOException
      Specified by:
      writeBytes in interface org.infinispan.protostream.TagWriter
      Throws:
      IOException
    • writeBytes

      public void writeBytes(int index, ByteBuffer value) throws IOException
      Specified by:
      writeBytes in interface org.infinispan.protostream.TagWriter
      Throws:
      IOException
    • writeString

      public void writeString(int index, String value) throws IOException
      Specified by:
      writeString in interface org.infinispan.protostream.TagWriter
      Throws:
      IOException
    • flush

      public void flush() throws IOException
      Specified by:
      flush in interface org.infinispan.protostream.TagWriter
      Throws:
      IOException
    • subWriter

      public org.infinispan.protostream.TagWriter subWriter(int number, boolean nested) throws IOException
      Specified by:
      subWriter in interface org.infinispan.protostream.TagWriter
      Throws:
      IOException