com.streambase.sb.client

## Class StreamBaseClient.SerializedTupleBuffer

- java.lang.Object
- - com.streambase.sb.client.StreamBaseClient.TupleBuffer
  - - com.streambase.sb.client.StreamBaseClient.SerializedTupleBuffer

- Enclosing class:
    StreamBaseClient

      public class StreamBaseClient.SerializedTupleBuffer
      extends StreamBaseClient.TupleBuffer

  A TupleBuffer which contains a byte buffer of serialized tuples including space for a network header

- - ### Field Summary

    - ### Fields inherited from class com.streambase.sb.client.StreamBaseClient.TupleBuffer

      `bufferTupleCount`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `SerializedTupleBuffer(StreamProperties props)` Constructor

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected void` | `addToBuffer(Tuple tuple, int id)` Possibly add a tuple if there is room
    `(package private) void` | `enqueue(boolean hasMore)` actually enqueue the buffer
    `ByteBuffer` | `getBuffer()` Return a ByteBuffer containing all of the tuples ready to be serialized also contains empty space at the beginning of the buffer for a network header
    `(package private) long` | `numBytes()` Number of bytes in buffer
    `(package private) void` | `recycle()` clear the buffer

    - ### Methods inherited from class com.streambase.sb.client.StreamBaseClient.TupleBuffer

      `addTuple, addTuples, canDequeue, canEnqueue, checkTuple, equals, hashCode, props, tupleCount`

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### SerializedTupleBuffer

          SerializedTupleBuffer(StreamProperties props)
                         throws StreamBaseException

      Constructor
      Parameters:
        `props` - Properties
      Throws:
        `StreamBaseException` - Error creating buffer

  - ### Method Detail

    - #### addToBuffer

          protected void addToBuffer(Tuple tuple,
                                     int id)
                              throws TupleException

      Possibly add a tuple if there is room
      Specified by:
        `addToBuffer` in class `StreamBaseClient.TupleBuffer`
      Parameters:
        `tuple` -
        `id` -
      Throws:
        `TupleException` - Error adding to buffer

    - #### getBuffer

          public ByteBuffer getBuffer()

      Return a ByteBuffer containing all of the tuples ready to be serialized also contains empty space at the beginning of the buffer for a network header
      Returns:
        byteBuffer containing serialized headers including empty space in the beginning for a network header

    - #### recycle

          void recycle()

      clear the buffer
      Overrides:
        `recycle` in class `StreamBaseClient.TupleBuffer`

    - #### enqueue

          void enqueue(boolean hasMore)
                throws StreamBaseException

      Description copied from class: `StreamBaseClient.TupleBuffer`
      actually enqueue the buffer
      Specified by:
        `enqueue` in class `StreamBaseClient.TupleBuffer`
      Parameters:
        `hasMore` - are there more Tuples in this batch of tuples
      Throws:
        `StreamBaseException`

    - #### numBytes

          long numBytes()

      Description copied from class: `StreamBaseClient.TupleBuffer`
      Number of bytes in buffer
      Specified by:
        `numBytes` in class `StreamBaseClient.TupleBuffer`
      Returns:
        Number of bytes

Copyright © 2015–2018 Cloud Software Group, Inc.. All rights reserved.