Class spng_chunk.Buffer

All Implemented Interfaces:
AutoCloseable, Iterable<spng_chunk>, NativeResource, Pointer
Enclosing class:
spng_chunk

public static class spng_chunk.Buffer extends StructBuffer<spng_chunk,spng_chunk.Buffer> implements NativeResource
An array of spng_chunk structs.
  • Constructor Details

    • Buffer

      public Buffer(ByteBuffer container)
      Creates a new spng_chunk.Buffer instance backed by the specified container.

      Changes to the container's content will be visible to the struct buffer instance and vice versa. The two buffers' position, limit, and mark values will be independent. The new buffer's position will be zero, its capacity and its limit will be the number of bytes remaining in this buffer divided by spng_chunk.SIZEOF, and its mark will be undefined.

      The created buffer instance holds a strong reference to the container object.

    • Buffer

      public Buffer(long address, int cap)
  • Method Details

    • offset

      public long offset()
      Returns:
      the value of the offset field.
    • length

      public int length()
      Returns:
      the value of the length field.
    • type

      public ByteBuffer type()
      Returns:
      a ByteBuffer view of the type field.
    • type

      public byte type(int index)
      Returns:
      the value at the specified index of the type field.
    • crc

      public int crc()
      Returns:
      the value of the crc field.
    • offset

      public spng_chunk.Buffer offset(long value)
      Sets the specified value to the offset field.
    • length

      public spng_chunk.Buffer length(int value)
      Sets the specified value to the length field.
    • type

      public spng_chunk.Buffer type(ByteBuffer value)
      Copies the specified ByteBuffer to the type field.
    • type

      public spng_chunk.Buffer type(int index, byte value)
      Sets the specified value at the specified index of the type field.
    • crc

      public spng_chunk.Buffer crc(int value)
      Sets the specified value to the crc field.