Interface ProtoStreamWriter

All Superinterfaces:
ProtoStreamOperation, org.infinispan.protostream.RawProtoStreamWriter, org.infinispan.protostream.TagWriter
All Known Implementing Classes:
AbstractProtoStreamWriter, DefaultProtoStreamWriter, OffsetProtoStreamWriter, SizeComputingProtoStreamWriter

public interface ProtoStreamWriter extends ProtoStreamOperation, org.infinispan.protostream.TagWriter
A TagWriter with the additional ability to write an arbitrary embedded object.
Author:
Paul Ferraro
  • Nested Class Summary

    Nested classes/interfaces inherited from interface org.wildfly.clustering.marshalling.protostream.ProtoStreamOperation

    ProtoStreamOperation.Context
  • Method Summary

    Modifier and Type
    Method
    Description
    createFieldSetWriter(Writable<T> writer, int startIndex)
    Creates a writer for a set of consecutive fields.
    default void
    writeAny(int index, Object value)
    Writes the specified object of an abitrary type using the specified index.
    void
    Writes the specified object of an arbitrary type.
    default <E extends Enum<E>>
    void
    writeEnum(int index, E value)
    Writes the specified enum field using the specified index.
    void
    writeFixed32(int index, int value)
    Deprecated.
    Use TagWriter.writeSFixed32(int, int) instead.
    void
    writeFixed64(int index, long value)
    Deprecated.
    Use TagWriter.writeSFixed64(int, long) instead.
    void
    writeInt32(int index, int value)
    Deprecated.
    Use TagWriter.writeUInt32(int, int) or TagWriter.writeSInt32(int, int)
    void
    writeInt64(int index, long value)
    Deprecated.
    Use TagWriter.writeUInt64(int, long) or TagWriter.writeSInt64(int, long)
    default void
    writeObject(int index, Object value)
    Writes the specified object of a specific type using the specified index.
    void
    Writes the specified object of a specific type.
    default void
    writeTag(int index, int wireType)
    Deprecated.
    Use TagWriter.writeTag(int, WireType) instead.

    Methods inherited from interface org.wildfly.clustering.marshalling.protostream.ProtoStreamOperation

    findMarshaller, getContext, getSerializationContext

    Methods inherited from interface org.infinispan.protostream.RawProtoStreamWriter

    writeRawByte, writeRawBytes, writeUInt32NoTag, writeUInt64NoTag

    Methods inherited from interface org.infinispan.protostream.TagWriter

    flush, writeBool, writeBytes, writeBytes, writeBytes, writeDouble, writeEnum, writeFloat, writeRawBytes, writeSFixed32, writeSFixed64, writeSInt32, writeSInt64, writeString, writeTag, writeUInt32, writeUInt64, writeVarint32, writeVarint64
  • Method Details

    • createFieldSetWriter

      <T> FieldSetWriter<T> createFieldSetWriter(Writable<T> writer, int startIndex)
      Creates a writer for a set of consecutive fields.
      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.
    • writeAny

      default void writeAny(int index, Object value) throws IOException
      Writes the specified object of an abitrary type using the specified index. Object will be read via ProtoStreamReader.readAny().
      Parameters:
      index - a field index
      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
    • writeObject

      default void writeObject(int index, Object value) throws IOException
      Writes the specified object of a specific type using the specified index. Object will be read via ProtoStreamReader.readObject(Class).
      Parameters:
      index - a field index
      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
    • writeAnyNoTag

      void writeAnyNoTag(Object value) throws IOException
      Writes the specified object of an arbitrary type. Must be preceded by {TagWriter.writeTag(int, org.infinispan.protostream.descriptors.WireType).
      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
    • writeObjectNoTag

      void writeObjectNoTag(Object value) throws IOException
      Writes the specified object of a specific type. Must be preceded by {TagWriter.writeTag(int, org.infinispan.protostream.descriptors.WireType).
      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
    • writeEnum

      default <E extends Enum<E>> void writeEnum(int index, E value) throws IOException
      Writes the specified enum field using the specified index. Object will be read via ProtoStreamReader.readEnum(Class).
      Parameters:
      index - a field index
      value - an enum 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

      @Deprecated default void writeTag(int index, int wireType) throws IOException
      Deprecated.
      Use TagWriter.writeTag(int, WireType) instead.
      Deprecated to discourage use.
      Specified by:
      writeTag in interface org.infinispan.protostream.RawProtoStreamWriter
      Specified by:
      writeTag in interface org.infinispan.protostream.TagWriter
      Throws:
      IOException
    • writeInt32

      @Deprecated void writeInt32(int index, int value) throws IOException
      Deprecated.
      Use TagWriter.writeUInt32(int, int) or TagWriter.writeSInt32(int, int)
      Deprecated to discourage use.
      Specified by:
      writeInt32 in interface org.infinispan.protostream.RawProtoStreamWriter
      Specified by:
      writeInt32 in interface org.infinispan.protostream.TagWriter
      Throws:
      IOException
    • writeInt64

      @Deprecated void writeInt64(int index, long value) throws IOException
      Deprecated.
      Use TagWriter.writeUInt64(int, long) or TagWriter.writeSInt64(int, long)
      Deprecated to discourage use.
      Specified by:
      writeInt64 in interface org.infinispan.protostream.RawProtoStreamWriter
      Specified by:
      writeInt64 in interface org.infinispan.protostream.TagWriter
      Throws:
      IOException
    • writeFixed32

      @Deprecated void writeFixed32(int index, int value) throws IOException
      Deprecated.
      Use TagWriter.writeSFixed32(int, int) instead.
      Deprecated to discourage use.
      Specified by:
      writeFixed32 in interface org.infinispan.protostream.RawProtoStreamWriter
      Specified by:
      writeFixed32 in interface org.infinispan.protostream.TagWriter
      Throws:
      IOException
    • writeFixed64

      @Deprecated void writeFixed64(int index, long value) throws IOException
      Deprecated.
      Use TagWriter.writeSFixed64(int, long) instead.
      Deprecated to discourage use.
      Specified by:
      writeFixed64 in interface org.infinispan.protostream.RawProtoStreamWriter
      Specified by:
      writeFixed64 in interface org.infinispan.protostream.TagWriter
      Throws:
      IOException