Class OGGPacket

All Implemented Interfaces:
Pointer

public class OGGPacket extends Struct<OGGPacket>

 struct ogg_packet {
     unsigned char * packet;
     long bytes;
     long b_o_s;
     long e_o_s;
     ogg_int64_t granulepos;
     ogg_int64_t packetno;
 }
  • Field Details

    • SIZEOF

      public static final int SIZEOF
      The struct size in bytes.
    • ALIGNOF

      public static final int ALIGNOF
      The struct alignment in bytes.
    • PACKET

      public static final int PACKET
      The struct member offsets.
    • BYTES

      public static final int BYTES
      The struct member offsets.
    • B_O_S

      public static final int B_O_S
      The struct member offsets.
    • E_O_S

      public static final int E_O_S
      The struct member offsets.
    • GRANULEPOS

      public static final int GRANULEPOS
      The struct member offsets.
    • PACKETNO

      public static final int PACKETNO
      The struct member offsets.
  • Constructor Details

    • OGGPacket

      public OGGPacket(ByteBuffer container)
      Creates a OGGPacket instance at the current position of the specified ByteBuffer container. Changes to the buffer's content will be visible to the struct instance and vice versa.

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

  • Method Details

    • sizeof

      public int sizeof()
      Description copied from class: Struct
      Returns sizeof(struct).
      Specified by:
      sizeof in class Struct<OGGPacket>
    • packet

      public ByteBuffer packet()
      Returns:
      a ByteBuffer view of the data pointed to by the packet field.
    • bytes

      public long bytes()
      Returns:
      the value of the bytes field.
    • b_o_s

      public long b_o_s()
      Returns:
      the value of the b_o_s field.
    • e_o_s

      public long e_o_s()
      Returns:
      the value of the e_o_s field.
    • granulepos

      public long granulepos()
      Returns:
      the value of the granulepos field.
    • packetno

      public long packetno()
      Returns:
      the value of the packetno field.
    • create

      public static OGGPacket create(long address)
      Returns a new OGGPacket instance for the specified memory address.
    • createSafe

      public static @Nullable OGGPacket createSafe(long address)
      Like create, but returns null if address is NULL.
    • create

      public static OGGPacket.Buffer create(long address, int capacity)
      Create a OGGPacket.Buffer instance at the specified memory.
      Parameters:
      address - the memory address
      capacity - the buffer capacity
    • createSafe

      public static @Nullable OGGPacket.Buffer createSafe(long address, int capacity)
      Like create, but returns null if address is NULL.
    • npacket

      public static ByteBuffer npacket(long struct)
      Unsafe version of packet.
    • nbytes

      public static long nbytes(long struct)
      Unsafe version of bytes().
    • nb_o_s

      public static long nb_o_s(long struct)
      Unsafe version of b_o_s().
    • ne_o_s

      public static long ne_o_s(long struct)
      Unsafe version of e_o_s().
    • ngranulepos

      public static long ngranulepos(long struct)
      Unsafe version of granulepos().
    • npacketno

      public static long npacketno(long struct)
      Unsafe version of packetno().