Interface StructuredWritableBuffer

    • Method Detail

      • set

        void set​(int index,
                 byte value)
        Sets the value at the specified index.
        Parameters:
        index - The index to set the value at.
        value - The Byte value to set.
        Throws:
        java.lang.ArrayIndexOutOfBoundsException - If index is invalid.
      • setShort

        void setShort​(int index,
                      short value)
        Sets a Short value at the specified index.
        Parameters:
        index - The index to set the value at.
        value - The Short value to set.
        Throws:
        java.lang.ArrayIndexOutOfBoundsException - If index is invalid or if there is insufficient space in the array starting at the specified index to fit the given value.
      • setInt

        void setInt​(int index,
                    int value)
        Sets a 32 bit Integer value at the specified index.
        Parameters:
        index - The index to set the value at.
        value - The Integer value to set.
        Throws:
        java.lang.ArrayIndexOutOfBoundsException - If index is invalid or if there is insufficient space in the array starting at the specified index to fit the given value.
      • setLong

        void setLong​(int index,
                     long value)
        Sets a 64 bit Long value at the specified index.
        Parameters:
        index - The index to set the value at.
        value - The Long value to set.
        Throws:
        java.lang.ArrayIndexOutOfBoundsException - If index is invalid or if there is insufficient space in the array starting at the specified index to fit the given value.
      • setUnsignedLong

        default void setUnsignedLong​(int index,
                                     long value)
        Sets a 64 bit Unsigned Long at the specified index. This value can then be deserialized using StructuredReadableBuffer.getUnsignedLong(int). This method is not interoperable with StructuredReadableBuffer.getLong(int). The advantage of serializing as Unsigned Long (vs. a normal Signed Long) is that the serialization will have the same natural order as the input value type (i.e., if compared using a lexicographic bitwise comparator such as BufferViewComparator, it will have the same ordering as the typical Long type).
        Parameters:
        index - The index to set the value at.
        value - The (signed) value to write. The value will be converted into the range [0, 2^64-1] before serialization by flipping the high order bit (so positive values will begin with 1 and negative values will begin with 0).
        Throws:
        java.lang.ArrayIndexOutOfBoundsException - If index is invalid or if there is insufficient space in the array starting at the specified index to fit the given value.