Package com.zeroc.Ice

Class OutputStream

java.lang.Object
com.zeroc.Ice.OutputStream

public class OutputStream extends Object
Interface to marshal (write) Slice types into sequence of bytes encoded using the Ice encoding.
See Also:
  • Constructor Summary

    Constructors
    Constructor
    Description
    Constructing an OutputStream without providing a communicator means the stream will use the default encoding version, the default format for class encoding, and a non-direct buffer.
    OutputStream(boolean direct)
    Constructing an OutputStream without providing a communicator means the stream will use the default encoding version and the default format for class encoding.
    OutputStream(Communicator communicator)
    This constructor uses the communicator's default encoding version.
    OutputStream(Communicator communicator, boolean direct)
    This constructor uses the communicator's default encoding version.
    OutputStream(Communicator communicator, EncodingVersion encoding)
    This constructor uses the given communicator and encoding version.
    OutputStream(Communicator communicator, EncodingVersion encoding, boolean direct)
    This constructor uses the given communicator and encoding version.
    OutputStream(com.zeroc.IceInternal.Instance instance, EncodingVersion encoding)
     
    OutputStream(com.zeroc.IceInternal.Instance instance, EncodingVersion encoding, boolean direct)
     
    OutputStream(com.zeroc.IceInternal.Instance instance, EncodingVersion encoding, com.zeroc.IceInternal.Buffer buf, boolean adopt)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Releases any data retained by encapsulations.
    void
    Ends the previous encapsulation.
    void
    Marks the end of a user exception.
    void
    endSize(int pos)
    Computes the amount of data written since the previous call to startSize and writes that value at the saved position.
    void
    Marks the end of a slice for a class instance or user exception.
    void
    Marks the end of a class instance.
    void
    expand(int n)
    Expand the stream to accept more data.
    byte[]
    Indicates that marshaling is finished.
    com.zeroc.IceInternal.Buffer
    Retrieves the internal data buffer.
    Retrieves the closure object associated with this stream.
    Determines the current encoding version.
    void
    initialize(Communicator communicator)
    Initializes the stream to use the communicator's default encoding version and class encoding format.
    void
    initialize(Communicator communicator, EncodingVersion encoding)
    Initializes the stream to use the given encoding version and the communicator's default class encoding format.
    com.zeroc.IceInternal.Instance
     
    boolean
    Determines whether the stream is empty.
    int
    pos()
    Determines the current position in the stream.
    void
    pos(int n)
    Sets the current position in the stream.
    com.zeroc.IceInternal.Buffer
    Prepares the internal data buffer to be written to a socket.
    void
    Resets this output stream.
    void
    resize(int sz)
    Resizes the stream to a new size.
    void
    rewriteBool(boolean v, int dest)
    Writes a boolean to the stream at the given position.
    void
    rewriteByte(byte v, int dest)
    Writes a byte to the stream at the given position.
    void
    rewriteInt(int v, int dest)
    Writes an int to the stream at the given position.
    Associates a closure object with this stream.
    void
    Sets the encoding format for class and exception instances.
    int
    Determines the current size of the stream.
    void
    Writes the start of an encapsulation to the stream.
    void
    Writes the start of an encapsulation to the stream.
    void
    Marks the start of a user exception.
    int
    Returns the current position and allocates four bytes for a fixed-length (32-bit) size value.
    void
    startSlice(String typeId, int compactId, boolean last)
    Marks the start of a new slice for a class instance or user exception.
    void
    Marks the start of a class instance.
    void
    Swaps the contents of one stream with another.
    void
    writeBlob(byte[] v)
    Writes a blob of bytes to the stream.
    void
    writeBlob(byte[] v, int off, int len)
    Writes a blob of bytes to the stream.
    void
    writeBool(boolean v)
    Writes a boolean to the stream.
    void
    writeBool(int tag, boolean v)
    Writes an optional boolean to the stream.
    void
    writeBool(int tag, Optional<Boolean> v)
    Writes an optional boolean to the stream.
    void
    writeBoolSeq(boolean[] v)
    Writes a boolean sequence to the stream.
    void
    writeBoolSeq(int tag, boolean[] v)
    Writes an optional boolean sequence to the stream.
    void
    writeBoolSeq(int tag, Optional<boolean[]> v)
    Writes an optional boolean sequence to the stream.
    void
    writeByte(byte v)
    Writes a byte to the stream.
    void
    writeByte(int tag, byte v)
    Writes an optional byte to the stream.
    void
    writeByte(int tag, Optional<Byte> v)
    Writes an optional byte to the stream.
    void
    Writes the remaining contents of the byte buffer as a byte sequence to the stream.
    void
    writeByteSeq(byte[] v)
    Writes a byte sequence to the stream.
    void
    writeByteSeq(int tag, byte[] v)
    Writes an optional byte sequence to the stream.
    void
    writeByteSeq(int tag, Optional<byte[]> v)
    Writes an optional byte sequence to the stream.
    void
    writeDouble(double v)
    Writes a double to the stream.
    void
    writeDouble(int tag, double v)
    Writes an optional double to the stream.
    void
    Writes an optional double to the stream.
    void
    Writes the remaining contents of the double buffer as a double sequence to the stream.
    void
    writeDoubleSeq(double[] v)
    Writes a double sequence to the stream.
    void
    writeDoubleSeq(int tag, double[] v)
    Writes an optional double sequence to the stream.
    void
    writeDoubleSeq(int tag, Optional<double[]> v)
    Writes an optional double sequence to the stream.
    void
    Writes an empty encapsulation using the given encoding version.
    void
    Writes a pre-encoded encapsulation.
    void
    writeEnum(int v, int maxValue)
    Write an enumerated value.
    void
    Writes a user exception to the stream.
    void
    writeFloat(float v)
    Writes a float to the stream.
    void
    writeFloat(int tag, float v)
    Writes an optional float to the stream.
    void
    writeFloat(int tag, Optional<Float> v)
    Writes an optional float to the stream.
    void
    Writes the remaining contents of the float buffer as a float sequence to the stream.
    void
    writeFloatSeq(float[] v)
    Writes a float sequence to the stream.
    void
    writeFloatSeq(int tag, float[] v)
    Writes an optional float sequence to the stream.
    void
    writeFloatSeq(int tag, Optional<float[]> v)
    Writes an optional float sequence to the stream.
    void
    writeInt(int v)
    Writes an int to the stream.
    void
    writeInt(int tag, int v)
    Writes an optional int to the stream.
    void
    writeInt(int tag, OptionalInt v)
    Writes an optional int to the stream.
    void
    Writes the remaining contents of the int buffer as an int sequence to the stream.
    void
    writeIntSeq(int[] v)
    Writes an int sequence to the stream.
    void
    writeIntSeq(int tag, int[] v)
    Writes an optional int sequence to the stream.
    void
    writeIntSeq(int tag, Optional<int[]> v)
    Writes an optional int sequence to the stream.
    void
    writeLong(int tag, long v)
    Writes an optional long to the stream.
    void
    writeLong(int tag, OptionalLong v)
    Writes an optional long to the stream.
    void
    writeLong(long v)
    Writes a long to the stream.
    void
    Writes the remaining contents of the long buffer as a long sequence to the stream.
    void
    writeLongSeq(int tag, long[] v)
    Writes an optional long sequence to the stream.
    void
    writeLongSeq(int tag, Optional<long[]> v)
    Writes an optional long sequence to the stream.
    void
    writeLongSeq(long[] v)
    Writes a long sequence to the stream.
    boolean
    writeOptional(int tag, OptionalFormat format)
    Write the header information for an optional value.
    void
    Writes the state of Slice classes whose index was previously written with writeValue(com.zeroc.Ice.Value) to the stream.
    void
    writeProxy(int tag, ObjectPrx v)
    Writes an optional proxy to the stream.
    void
    Writes an optional proxy to the stream.
    void
    Writes a proxy to the stream.
    void
    Writes an optional serializable Java object to the stream.
    <T extends Serializable>
    void
    writeSerializable(int tag, Optional<T> v)
    Writes an optional serializable Java object to the stream.
    void
    Writes a serializable Java object to the stream.
    void
    writeShort(int tag, short v)
    Writes an optional short to the stream.
    void
    writeShort(int tag, Optional<Short> v)
    Writes an optional short to the stream.
    void
    writeShort(short v)
    Writes a short to the stream.
    void
    Writes the remaining contents of the short buffer as a short sequence to the stream.
    void
    writeShortSeq(int tag, short[] v)
    Writes an optional short sequence to the stream.
    void
    writeShortSeq(int tag, Optional<short[]> v)
    Writes an optional short sequence to the stream.
    void
    writeShortSeq(short[] v)
    Writes a short sequence to the stream.
    void
    writeSize(int v)
    Writes a size to the stream.
    void
    writeString(int tag, String v)
    Writes an optional string to the stream.
    void
    writeString(int tag, Optional<String> v)
    Writes an optional string to the stream.
    void
    Writes a string to the stream.
    void
    writeStringSeq(int tag, String[] v)
    Writes an optional string sequence to the stream.
    void
    writeStringSeq(int tag, Optional<String[]> v)
    Writes an optional string sequence to the stream.
    void
    Writes a string sequence to the stream.
    void
    writeValue(int tag, Value v)
    Writes an optional value to the stream.
    <T extends Value>
    void
    writeValue(int tag, Optional<T> v)
    Writes an optional value to the stream.
    void
    Writes a Slice value to the stream.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • OutputStream

      public OutputStream()
      Constructing an OutputStream without providing a communicator means the stream will use the default encoding version, the default format for class encoding, and a non-direct buffer. You can supply a communicator later by calling initialize().
    • OutputStream

      public OutputStream(boolean direct)
      Constructing an OutputStream without providing a communicator means the stream will use the default encoding version and the default format for class encoding. You can supply a communicator later by calling initialize().
      Parameters:
      direct - Indicates whether to use a direct buffer.
    • OutputStream

      public OutputStream(Communicator communicator)
      This constructor uses the communicator's default encoding version.
      Parameters:
      communicator - The communicator to use when initializing the stream.
    • OutputStream

      public OutputStream(Communicator communicator, boolean direct)
      This constructor uses the communicator's default encoding version.
      Parameters:
      communicator - The communicator to use when initializing the stream.
      direct - Indicates whether to use a direct buffer.
    • OutputStream

      public OutputStream(Communicator communicator, EncodingVersion encoding)
      This constructor uses the given communicator and encoding version.
      Parameters:
      communicator - The communicator to use when initializing the stream.
      encoding - The desired Ice encoding version.
    • OutputStream

      public OutputStream(Communicator communicator, EncodingVersion encoding, boolean direct)
      This constructor uses the given communicator and encoding version.
      Parameters:
      communicator - The communicator to use when initializing the stream.
      encoding - The desired Ice encoding version.
      direct - Indicates whether to use a direct buffer.
    • OutputStream

      public OutputStream(com.zeroc.IceInternal.Instance instance, EncodingVersion encoding)
    • OutputStream

      public OutputStream(com.zeroc.IceInternal.Instance instance, EncodingVersion encoding, boolean direct)
    • OutputStream

      public OutputStream(com.zeroc.IceInternal.Instance instance, EncodingVersion encoding, com.zeroc.IceInternal.Buffer buf, boolean adopt)
  • Method Details

    • initialize

      public void initialize(Communicator communicator)
      Initializes the stream to use the communicator's default encoding version and class encoding format.
      Parameters:
      communicator - The communicator to use when initializing the stream.
    • initialize

      public void initialize(Communicator communicator, EncodingVersion encoding)
      Initializes the stream to use the given encoding version and the communicator's default class encoding format.
      Parameters:
      communicator - The communicator to use when initializing the stream.
      encoding - The desired Ice encoding version.
    • reset

      public void reset()
      Resets this output stream. This method allows the stream to be reused, to avoid creating unnecessary garbage.
    • clear

      public void clear()
      Releases any data retained by encapsulations. The reset() method internally calls clear.
    • instance

      public com.zeroc.IceInternal.Instance instance()
    • setFormat

      public void setFormat(FormatType fmt)
      Sets the encoding format for class and exception instances.
      Parameters:
      fmt - The encoding format.
    • getClosure

      public Object getClosure()
      Retrieves the closure object associated with this stream.
      Returns:
      The closure object.
    • setClosure

      public Object setClosure(Object p)
      Associates a closure object with this stream.
      Parameters:
      p - The new closure object.
      Returns:
      The previous closure object, or null.
    • finished

      public byte[] finished()
      Indicates that marshaling is finished.
      Returns:
      The byte sequence containing the encoded data.
    • swap

      public void swap(OutputStream other)
      Swaps the contents of one stream with another.
      Parameters:
      other - The other stream.
    • resize

      public void resize(int sz)
      Resizes the stream to a new size.
      Parameters:
      sz - The new size.
    • prepareWrite

      public com.zeroc.IceInternal.Buffer prepareWrite()
      Prepares the internal data buffer to be written to a socket.
      Returns:
      The internal buffer.
    • getBuffer

      public com.zeroc.IceInternal.Buffer getBuffer()
      Retrieves the internal data buffer.
      Returns:
      The buffer.
    • startValue

      public void startValue(SlicedData data)
      Marks the start of a class instance.
      Parameters:
      data - Preserved slices for this instance, or null.
    • endValue

      public void endValue()
      Marks the end of a class instance.
    • startException

      public void startException(SlicedData data)
      Marks the start of a user exception.
      Parameters:
      data - Preserved slices for this exception, or null.
    • endException

      public void endException()
      Marks the end of a user exception.
    • startEncapsulation

      public void startEncapsulation()
      Writes the start of an encapsulation to the stream.
    • startEncapsulation

      public void startEncapsulation(EncodingVersion encoding, FormatType format)
      Writes the start of an encapsulation to the stream.
      Parameters:
      encoding - The encoding version of the encapsulation.
      format - Specify the compact or sliced format.
    • endEncapsulation

      public void endEncapsulation()
      Ends the previous encapsulation.
    • writeEmptyEncapsulation

      public void writeEmptyEncapsulation(EncodingVersion encoding)
      Writes an empty encapsulation using the given encoding version.
      Parameters:
      encoding - The desired encoding version.
    • writeEncapsulation

      public void writeEncapsulation(byte[] v)
      Writes a pre-encoded encapsulation.
      Parameters:
      v - The encapsulation data.
    • getEncoding

      public EncodingVersion getEncoding()
      Determines the current encoding version.
      Returns:
      The encoding version.
    • startSlice

      public void startSlice(String typeId, int compactId, boolean last)
      Marks the start of a new slice for a class instance or user exception.
      Parameters:
      typeId - The Slice type ID corresponding to this slice.
      compactId - The Slice compact type ID corresponding to this slice or -1 if no compact ID is defined for the type ID.
      last - True if this is the last slice, false otherwise.
    • endSlice

      public void endSlice()
      Marks the end of a slice for a class instance or user exception.
    • writePendingValues

      public void writePendingValues()
      Writes the state of Slice classes whose index was previously written with writeValue(com.zeroc.Ice.Value) to the stream.
    • writeSize

      public void writeSize(int v)
      Writes a size to the stream.
      Parameters:
      v - The size to write.
    • startSize

      public int startSize()
      Returns the current position and allocates four bytes for a fixed-length (32-bit) size value.
      Returns:
      The current position.
    • endSize

      public void endSize(int pos)
      Computes the amount of data written since the previous call to startSize and writes that value at the saved position.
      Parameters:
      pos - The saved position.
    • writeBlob

      public void writeBlob(byte[] v)
      Writes a blob of bytes to the stream.
      Parameters:
      v - The byte array to be written. All of the bytes in the array are written.
    • writeBlob

      public void writeBlob(byte[] v, int off, int len)
      Writes a blob of bytes to the stream.
      Parameters:
      v - The byte array to be written.
      off - The offset into the byte array from which to copy.
      len - The number of bytes from the byte array to copy.
    • writeOptional

      public boolean writeOptional(int tag, OptionalFormat format)
      Write the header information for an optional value.
      Parameters:
      tag - The numeric tag associated with the value.
      format - The optional format of the value.
      Returns:
      True if the current encoding supports optionals, false otherwise.
    • writeByte

      public void writeByte(byte v)
      Writes a byte to the stream.
      Parameters:
      v - The byte to write to the stream.
    • writeByte

      public void writeByte(int tag, Optional<Byte> v)
      Writes an optional byte to the stream.
      Parameters:
      tag - The optional tag.
      v - The optional byte to write to the stream.
    • writeByte

      public void writeByte(int tag, byte v)
      Writes an optional byte to the stream.
      Parameters:
      tag - The optional tag.
      v - The byte to write to the stream.
    • rewriteByte

      public void rewriteByte(byte v, int dest)
      Writes a byte to the stream at the given position. The current position of the stream is not modified.
      Parameters:
      v - The byte to write to the stream.
      dest - The position at which to store the byte in the buffer.
    • writeByteSeq

      public void writeByteSeq(byte[] v)
      Writes a byte sequence to the stream.
      Parameters:
      v - The byte sequence to write to the stream. Passing null causes an empty sequence to be written to the stream.
    • writeByteSeq

      public void writeByteSeq(int tag, Optional<byte[]> v)
      Writes an optional byte sequence to the stream.
      Parameters:
      tag - The optional tag.
      v - The optional byte sequence to write to the stream.
    • writeByteSeq

      public void writeByteSeq(int tag, byte[] v)
      Writes an optional byte sequence to the stream.
      Parameters:
      tag - The optional tag.
      v - The byte sequence to write to the stream.
    • writeByteBuffer

      public void writeByteBuffer(ByteBuffer v)
      Writes the remaining contents of the byte buffer as a byte sequence to the stream.
      Parameters:
      v - The byte buffer to write to the stream.
    • writeSerializable

      public void writeSerializable(Serializable o)
      Writes a serializable Java object to the stream.
      Parameters:
      o - The serializable object to write.
    • writeSerializable

      public <T extends Serializable> void writeSerializable(int tag, Optional<T> v)
      Writes an optional serializable Java object to the stream.
      Type Parameters:
      T - The serializable class.
      Parameters:
      tag - The optional tag.
      v - The optional serializable object to write.
    • writeSerializable

      public void writeSerializable(int tag, Serializable v)
      Writes an optional serializable Java object to the stream.
      Parameters:
      tag - The optional tag.
      v - The serializable object to write.
    • writeBool

      public void writeBool(boolean v)
      Writes a boolean to the stream.
      Parameters:
      v - The boolean to write to the stream.
    • writeBool

      public void writeBool(int tag, Optional<Boolean> v)
      Writes an optional boolean to the stream.
      Parameters:
      tag - The optional tag.
      v - The optional boolean to write to the stream.
    • writeBool

      public void writeBool(int tag, boolean v)
      Writes an optional boolean to the stream.
      Parameters:
      tag - The optional tag.
      v - The boolean to write to the stream.
    • rewriteBool

      public void rewriteBool(boolean v, int dest)
      Writes a boolean to the stream at the given position. The current position of the stream is not modified.
      Parameters:
      v - The boolean to write to the stream.
      dest - The position at which to store the boolean in the buffer.
    • writeBoolSeq

      public void writeBoolSeq(boolean[] v)
      Writes a boolean sequence to the stream.
      Parameters:
      v - The boolean sequence to write to the stream. Passing null causes an empty sequence to be written to the stream.
    • writeBoolSeq

      public void writeBoolSeq(int tag, Optional<boolean[]> v)
      Writes an optional boolean sequence to the stream.
      Parameters:
      tag - The optional tag.
      v - The optional boolean sequence to write to the stream.
    • writeBoolSeq

      public void writeBoolSeq(int tag, boolean[] v)
      Writes an optional boolean sequence to the stream.
      Parameters:
      tag - The optional tag.
      v - The boolean sequence to write to the stream.
    • writeShort

      public void writeShort(short v)
      Writes a short to the stream.
      Parameters:
      v - The short to write to the stream.
    • writeShort

      public void writeShort(int tag, Optional<Short> v)
      Writes an optional short to the stream.
      Parameters:
      tag - The optional tag.
      v - The optional short to write to the stream.
    • writeShort

      public void writeShort(int tag, short v)
      Writes an optional short to the stream.
      Parameters:
      tag - The optional tag.
      v - The short to write to the stream.
    • writeShortSeq

      public void writeShortSeq(short[] v)
      Writes a short sequence to the stream.
      Parameters:
      v - The short sequence to write to the stream. Passing null causes an empty sequence to be written to the stream.
    • writeShortSeq

      public void writeShortSeq(int tag, Optional<short[]> v)
      Writes an optional short sequence to the stream.
      Parameters:
      tag - The optional tag.
      v - The optional short sequence to write to the stream.
    • writeShortSeq

      public void writeShortSeq(int tag, short[] v)
      Writes an optional short sequence to the stream.
      Parameters:
      tag - The optional tag.
      v - The short sequence to write to the stream.
    • writeShortBuffer

      public void writeShortBuffer(ShortBuffer v)
      Writes the remaining contents of the short buffer as a short sequence to the stream.
      Parameters:
      v - The short buffer to write to the stream.
    • writeInt

      public void writeInt(int v)
      Writes an int to the stream.
      Parameters:
      v - The int to write to the stream.
    • writeInt

      public void writeInt(int tag, OptionalInt v)
      Writes an optional int to the stream.
      Parameters:
      tag - The optional tag.
      v - The optional int to write to the stream.
    • writeInt

      public void writeInt(int tag, int v)
      Writes an optional int to the stream.
      Parameters:
      tag - The optional tag.
      v - The int to write to the stream.
    • rewriteInt

      public void rewriteInt(int v, int dest)
      Writes an int to the stream at the given position. The current position of the stream is not modified.
      Parameters:
      v - The int to write to the stream.
      dest - The position at which to store the int in the buffer.
    • writeIntSeq

      public void writeIntSeq(int[] v)
      Writes an int sequence to the stream.
      Parameters:
      v - The int sequence to write to the stream. Passing null causes an empty sequence to be written to the stream.
    • writeIntSeq

      public void writeIntSeq(int tag, Optional<int[]> v)
      Writes an optional int sequence to the stream.
      Parameters:
      tag - The optional tag.
      v - The optional int sequence to write to the stream.
    • writeIntSeq

      public void writeIntSeq(int tag, int[] v)
      Writes an optional int sequence to the stream.
      Parameters:
      tag - The optional tag.
      v - The int sequence to write to the stream.
    • writeIntBuffer

      public void writeIntBuffer(IntBuffer v)
      Writes the remaining contents of the int buffer as an int sequence to the stream.
      Parameters:
      v - The int buffer to write to the stream.
    • writeLong

      public void writeLong(long v)
      Writes a long to the stream.
      Parameters:
      v - The long to write to the stream.
    • writeLong

      public void writeLong(int tag, OptionalLong v)
      Writes an optional long to the stream.
      Parameters:
      tag - The optional tag.
      v - The optional long to write to the stream.
    • writeLong

      public void writeLong(int tag, long v)
      Writes an optional long to the stream.
      Parameters:
      tag - The optional tag.
      v - The long to write to the stream.
    • writeLongSeq

      public void writeLongSeq(long[] v)
      Writes a long sequence to the stream.
      Parameters:
      v - The long sequence to write to the stream. Passing null causes an empty sequence to be written to the stream.
    • writeLongSeq

      public void writeLongSeq(int tag, Optional<long[]> v)
      Writes an optional long sequence to the stream.
      Parameters:
      tag - The optional tag.
      v - The optional long sequence to write to the stream.
    • writeLongSeq

      public void writeLongSeq(int tag, long[] v)
      Writes an optional long sequence to the stream.
      Parameters:
      tag - The optional tag.
      v - The long sequence to write to the stream.
    • writeLongBuffer

      public void writeLongBuffer(LongBuffer v)
      Writes the remaining contents of the long buffer as a long sequence to the stream.
      Parameters:
      v - The long buffer to write to the stream.
    • writeFloat

      public void writeFloat(float v)
      Writes a float to the stream.
      Parameters:
      v - The float to write to the stream.
    • writeFloat

      public void writeFloat(int tag, Optional<Float> v)
      Writes an optional float to the stream.
      Parameters:
      tag - The optional tag.
      v - The optional float to write to the stream.
    • writeFloat

      public void writeFloat(int tag, float v)
      Writes an optional float to the stream.
      Parameters:
      tag - The optional tag.
      v - The float to write to the stream.
    • writeFloatSeq

      public void writeFloatSeq(float[] v)
      Writes a float sequence to the stream.
      Parameters:
      v - The float sequence to write to the stream. Passing null causes an empty sequence to be written to the stream.
    • writeFloatSeq

      public void writeFloatSeq(int tag, Optional<float[]> v)
      Writes an optional float sequence to the stream.
      Parameters:
      tag - The optional tag.
      v - The optional float sequence to write to the stream.
    • writeFloatSeq

      public void writeFloatSeq(int tag, float[] v)
      Writes an optional float sequence to the stream.
      Parameters:
      tag - The optional tag.
      v - The float sequence to write to the stream.
    • writeFloatBuffer

      public void writeFloatBuffer(FloatBuffer v)
      Writes the remaining contents of the float buffer as a float sequence to the stream.
      Parameters:
      v - The float buffer to write to the stream.
    • writeDouble

      public void writeDouble(double v)
      Writes a double to the stream.
      Parameters:
      v - The double to write to the stream.
    • writeDouble

      public void writeDouble(int tag, OptionalDouble v)
      Writes an optional double to the stream.
      Parameters:
      tag - The optional tag.
      v - The optional double to write to the stream.
    • writeDouble

      public void writeDouble(int tag, double v)
      Writes an optional double to the stream.
      Parameters:
      tag - The optional tag.
      v - The double to write to the stream.
    • writeDoubleSeq

      public void writeDoubleSeq(double[] v)
      Writes a double sequence to the stream.
      Parameters:
      v - The double sequence to write to the stream. Passing null causes an empty sequence to be written to the stream.
    • writeDoubleSeq

      public void writeDoubleSeq(int tag, Optional<double[]> v)
      Writes an optional double sequence to the stream.
      Parameters:
      tag - The optional tag.
      v - The optional double sequence to write to the stream.
    • writeDoubleSeq

      public void writeDoubleSeq(int tag, double[] v)
      Writes an optional double sequence to the stream.
      Parameters:
      tag - The optional tag.
      v - The double sequence to write to the stream.
    • writeDoubleBuffer

      public void writeDoubleBuffer(DoubleBuffer v)
      Writes the remaining contents of the double buffer as a double sequence to the stream.
      Parameters:
      v - The double buffer to write to the stream.
    • writeString

      public void writeString(String v)
      Writes a string to the stream.
      Parameters:
      v - The string to write to the stream. Passing null causes an empty string to be written to the stream.
    • writeString

      public void writeString(int tag, Optional<String> v)
      Writes an optional string to the stream.
      Parameters:
      tag - The optional tag.
      v - The optional string to write to the stream.
    • writeString

      public void writeString(int tag, String v)
      Writes an optional string to the stream.
      Parameters:
      tag - The optional tag.
      v - The string to write to the stream.
    • writeStringSeq

      public void writeStringSeq(String[] v)
      Writes a string sequence to the stream.
      Parameters:
      v - The string sequence to write to the stream. Passing null causes an empty sequence to be written to the stream.
    • writeStringSeq

      public void writeStringSeq(int tag, Optional<String[]> v)
      Writes an optional string sequence to the stream.
      Parameters:
      tag - The optional tag.
      v - The optional string sequence to write to the stream.
    • writeStringSeq

      public void writeStringSeq(int tag, String[] v)
      Writes an optional string sequence to the stream.
      Parameters:
      tag - The optional tag.
      v - The string sequence to write to the stream.
    • writeProxy

      public void writeProxy(ObjectPrx v)
      Writes a proxy to the stream.
      Parameters:
      v - The proxy to write.
    • writeProxy

      public void writeProxy(int tag, Optional<ObjectPrx> v)
      Writes an optional proxy to the stream.
      Parameters:
      tag - The optional tag.
      v - The optional proxy to write to the stream.
    • writeProxy

      public void writeProxy(int tag, ObjectPrx v)
      Writes an optional proxy to the stream.
      Parameters:
      tag - The optional tag.
      v - The proxy to write to the stream.
    • writeEnum

      public void writeEnum(int v, int maxValue)
      Write an enumerated value.
      Parameters:
      v - The enumerator.
      maxValue - The maximum enumerator value in the definition.
    • writeValue

      public void writeValue(Value v)
      Writes a Slice value to the stream.
      Parameters:
      v - The value to write. This method writes the index of an instance; the state of the value is written once writePendingValues() is called.
    • writeValue

      public <T extends Value> void writeValue(int tag, Optional<T> v)
      Writes an optional value to the stream.
      Type Parameters:
      T - The type of the optional value.
      Parameters:
      tag - The optional tag.
      v - The optional value to write to the stream.
    • writeValue

      public void writeValue(int tag, Value v)
      Writes an optional value to the stream.
      Parameters:
      tag - The optional tag.
      v - The value to write to the stream.
    • writeException

      public void writeException(UserException v)
      Writes a user exception to the stream.
      Parameters:
      v - The user exception to write.
    • pos

      public int pos()
      Determines the current position in the stream.
      Returns:
      The current position.
    • pos

      public void pos(int n)
      Sets the current position in the stream.
      Parameters:
      n - The new position.
    • size

      public int size()
      Determines the current size of the stream.
      Returns:
      The current size.
    • isEmpty

      public boolean isEmpty()
      Determines whether the stream is empty.
      Returns:
      True if no data has been written yet, false otherwise.
    • expand

      public void expand(int n)
      Expand the stream to accept more data.
      Parameters:
      n - The number of bytes to accommodate in the stream.