Class ByteReader

java.lang.Object
org.javagi.base.ProxyInstance
org.freedesktop.gstreamer.base.ByteReader
All Implemented Interfaces:
Proxy

@Generated("org.javagi.JavaGI") public class ByteReader extends ProxyInstance
GstByteReader provides a byte reader that can read different integer and floating point types from a memory buffer. It provides functions for reading signed/unsigned, little/big endian integers of 8, 16, 24, 32 and 64 bits and functions for reading little/big endian floating points numbers of 32 and 64 bits. It also provides functions to read NUL-terminated strings in various character encodings.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Allocate a new ByteReader.
    ByteReader(byte[] data, int size, int byte_)
    Allocate a new ByteReader with the fields set to the provided values.
    ByteReader(byte[] data, int size, int byte_, Arena arena)
    Allocate a new ByteReader with the fields set to the provided values.
    Allocate a new ByteReader.
    Create a ByteReader proxy instance for the provided memory address.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    dupData(@Nullable Out<byte[]> val)
    Free-function: g_free
    boolean
    dupStringUtf32(@Nullable Out<int[]> str)
    Free-function: g_free
    boolean
    dupStringUtf8(@Nullable Out<String[]> str)
    Free-function: g_free
    void
    Frees a GstByteReader instance, which was previously allocated by gst_byte_reader_new().
    boolean
    getData(@Nullable Out<byte[]> val)
    Returns a constant pointer to the current data position if at least size bytes are left and updates the current position.
    boolean
    Read a 32 bit big endian floating point value into val and update the current position.
    boolean
    Read a 32 bit little endian floating point value into val and update the current position.
    boolean
    Read a 64 bit big endian floating point value into val and update the current position.
    boolean
    Read a 64 bit little endian floating point value into val and update the current position.
    boolean
    Read a signed 16 bit big endian integer into val and update the current position.
    boolean
    Read a signed 16 bit little endian integer into val and update the current position.
    boolean
    Read a signed 24 bit big endian integer into val and update the current position.
    boolean
    Read a signed 24 bit little endian integer into val and update the current position.
    boolean
    Read a signed 32 bit big endian integer into val and update the current position.
    boolean
    Read a signed 32 bit little endian integer into val and update the current position.
    boolean
    Read a signed 64 bit big endian integer into val and update the current position.
    boolean
    Read a signed 64 bit little endian integer into val and update the current position.
    boolean
    Read a signed 8 bit integer into val and update the current position.
    The memory layout of the native struct.
    int
    Returns the current position of a GstByteReader instance in bytes.
    int
    Returns the remaining number of bytes of a GstByteReader instance.
    int
    Returns the total number of bytes of a GstByteReader instance.
    boolean
    getStringUtf8(@Nullable Out<String[]> str)
    Returns a constant pointer to the current data position if there is a NUL-terminated string in the data (this could be just a NUL terminator), advancing the current position to the byte after the string.
    boolean
    getSubReader(ByteReader subReader, int size)
    Initializes a GstByteReader sub-reader instance to contain size bytes of data from the current position of reader. This is useful to read chunked formats and make sure that one doesn't read beyond the size of the sub-chunk.
    boolean
    Read an unsigned 16 bit big endian integer into val and update the current position.
    boolean
    Read an unsigned 16 bit little endian integer into val and update the current position.
    boolean
    Read an unsigned 24 bit big endian integer into val and update the current position.
    boolean
    Read an unsigned 24 bit little endian integer into val and update the current position.
    boolean
    Read an unsigned 32 bit big endian integer into val and update the current position.
    boolean
    Read an unsigned 32 bit little endian integer into val and update the current position.
    boolean
    Read an unsigned 64 bit big endian integer into val and update the current position.
    boolean
    Read an unsigned 64 bit little endian integer into val and update the current position.
    boolean
    Read an unsigned 8 bit integer into val and update the current position.
    void
    init(@Nullable byte @Nullable [] data)
    Initializes a GstByteReader instance to read from data. This function can be called on already initialized instances.
    int
    maskedScanUint32(int mask, int pattern, int offset, int size)
    Scan for pattern pattern with applied mask mask in the byte reader data, starting from offset offset relative to the current position.
    int
    maskedScanUint32Peek(int mask, int pattern, int offset, int size, Out<Integer> value)
    Scan for pattern pattern with applied mask mask in the byte reader data, starting from offset offset relative to the current position.
    static ByteReader
    new_(@Nullable byte @Nullable [] data)
    Create a new GstByteReader instance, which will read from data.
    boolean
    peekData(@Nullable Out<byte[]> val)
    Returns a constant pointer to the current data position if at least size bytes are left and keeps the current position.
    boolean
    Read a 32 bit big endian floating point value into val but keep the current position.
    boolean
    Read a 32 bit little endian floating point value into val but keep the current position.
    boolean
    Read a 64 bit big endian floating point value into val but keep the current position.
    boolean
    Read a 64 bit little endian floating point value into val but keep the current position.
    boolean
    Read a signed 16 bit big endian integer into val but keep the current position.
    boolean
    Read a signed 16 bit little endian integer into val but keep the current position.
    boolean
    Read a signed 24 bit big endian integer into val but keep the current position.
    boolean
    Read a signed 24 bit little endian integer into val but keep the current position.
    boolean
    Read a signed 32 bit big endian integer into val but keep the current position.
    boolean
    Read a signed 32 bit little endian integer into val but keep the current position.
    boolean
    Read a signed 64 bit big endian integer into val but keep the current position.
    boolean
    Read a signed 64 bit little endian integer into val but keep the current position.
    boolean
    Read a signed 8 bit integer into val but keep the current position.
    boolean
    peekStringUtf8(@Nullable Out<String[]> str)
    Returns a constant pointer to the current data position if there is a NUL-terminated string in the data (this could be just a NUL terminator).
    boolean
    peekSubReader(ByteReader subReader, int size)
    Initializes a GstByteReader sub-reader instance to contain size bytes of data from the current position of reader. This is useful to read chunked formats and make sure that one doesn't read beyond the size of the sub-chunk.
    boolean
    Read an unsigned 16 bit big endian integer into val but keep the current position.
    boolean
    Read an unsigned 16 bit little endian integer into val but keep the current position.
    boolean
    Read an unsigned 24 bit big endian integer into val but keep the current position.
    boolean
    Read an unsigned 24 bit little endian integer into val but keep the current position.
    boolean
    Read an unsigned 32 bit big endian integer into val but keep the current position.
    boolean
    Read an unsigned 32 bit little endian integer into val but keep the current position.
    boolean
    Read an unsigned 64 bit big endian integer into val but keep the current position.
    boolean
    Read an unsigned 64 bit little endian integer into val but keep the current position.
    boolean
    Read an unsigned 8 bit integer into val but keep the current position.
    int
    Read the value of the field byte.
    @Nullable byte @Nullable []
    Read the value of the field data.
    int
    Read the value of the field size.
    boolean
    setPos(int pos)
    Sets the new position of a GstByteReader instance to pos in bytes.
    boolean
    skip(int nbytes)
    Skips nbytes bytes of the GstByteReader instance.
    boolean
    Skips a NUL-terminated UTF-16 string in the GstByteReader instance, advancing the current position to the byte after the string.
    boolean
    Skips a NUL-terminated UTF-32 string in the GstByteReader instance, advancing the current position to the byte after the string.
    boolean
    Skips a NUL-terminated string in the GstByteReader instance, advancing the current position to the byte after the string.
    void
    writeByte(int byte_)
    Write a value in the field byte.
    void
    writeData(@Nullable byte @Nullable [] data, Arena _arena)
    Write a value in the field data.
    void
    writeSize(int size)
    Write a value in the field size.

    Methods inherited from class ProxyInstance

    equals, handle, hashCode

    Methods inherited from class Object

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

    • ByteReader

      public ByteReader(MemorySegment address)
      Create a ByteReader proxy instance for the provided memory address.
      Parameters:
      address - the memory address of the native object
    • ByteReader

      public ByteReader(Arena arena)
      Allocate a new ByteReader.
      Parameters:
      arena - to control the memory allocation scope
    • ByteReader

      public ByteReader()
      Allocate a new ByteReader. The memory is allocated with Arena.ofAuto().
    • ByteReader

      public ByteReader(byte[] data, int size, int byte_, Arena arena)
      Allocate a new ByteReader with the fields set to the provided values.
      Parameters:
      data - value for the field data
      size - value for the field size
      byte_ - value for the field byte_
      arena - to control the memory allocation scope
    • ByteReader

      public ByteReader(byte[] data, int size, int byte_)
      Allocate a new ByteReader with the fields set to the provided values. The memory is allocated with Arena.ofAuto().
      Parameters:
      data - value for the field data
      size - value for the field size
      byte_ - value for the field byte_
  • Method Details

    • getMemoryLayout

      public static MemoryLayout getMemoryLayout()
      The memory layout of the native struct.
      Returns:
      the memory layout
    • readData

      public @Nullable byte @Nullable [] readData()
      Read the value of the field data.
      Returns:
      The value of the field data
    • writeData

      public void writeData(@Nullable byte @Nullable [] data, Arena _arena)
      Write a value in the field data.
      Parameters:
      data - The new value for the field data
      _arena - to control the memory allocation scope
    • readSize

      public int readSize()
      Read the value of the field size.
      Returns:
      The value of the field size
    • writeSize

      public void writeSize(int size)
      Write a value in the field size.
      Parameters:
      size - The new value for the field size
    • readByte

      public int readByte()
      Read the value of the field byte.
      Returns:
      The value of the field byte
    • writeByte

      public void writeByte(int byte_)
      Write a value in the field byte.
      Parameters:
      byte_ - The new value for the field byte
    • new_

      public static ByteReader new_(@Nullable byte @Nullable [] data)

      Create a new GstByteReader instance, which will read from data.

      Free-function: gst_byte_reader_free

      Parameters:
      data - data from which the GstByteReader should read
      Returns:
      a new GstByteReader instance
    • dupData

      public boolean dupData(@Nullable Out<byte[]> val)

      Free-function: g_free

      Returns a newly-allocated copy of the current data position if at least size bytes are left and updates the current position. Free with g_free() when no longer needed.

      Parameters:
      val - address of a guint8 pointer variable in which to store the result
      Returns:
      true if successful, false otherwise.
    • dupStringUtf32

      public boolean dupStringUtf32(@Nullable Out<int[]> str)

      Free-function: g_free

      Returns a newly-allocated copy of the current data position if there is a NUL-terminated UTF-32 string in the data (this could be an empty string as well), and advances the current position.

      No input checking for valid UTF-32 is done. This function is endianness agnostic - you should not assume the UTF-32 characters are in host endianness.

      This function will fail if no NUL-terminator was found in in the data.

      Note: there is no peek or get variant of this function to ensure correct byte alignment of the UTF-32 string.

      Parameters:
      str - address of a guint32 pointer variable in which to store the result
      Returns:
      true if a string could be read, false otherwise. The string put into str must be freed with g_free() when no longer needed.
    • dupStringUtf8

      public boolean dupStringUtf8(@Nullable Out<String[]> str)

      Free-function: g_free

      FIXME:Reads (copies) a NUL-terminated string in the GstByteReader instance, advancing the current position to the byte after the string. This will work for any NUL-terminated string with a character width of 8 bits, so ASCII, UTF-8, ISO-8859-N etc. No input checking for valid UTF-8 is done.

      This function will fail if no NUL-terminator was found in in the data.

      Parameters:
      str - address of a gchar pointer variable in which to store the result
      Returns:
      true if a string could be read into str, false otherwise. The string put into str must be freed with g_free() when no longer needed.
    • free

      public void free()
      Frees a GstByteReader instance, which was previously allocated by gst_byte_reader_new().
    • getData

      public boolean getData(@Nullable Out<byte[]> val)
      Returns a constant pointer to the current data position if at least size bytes are left and updates the current position.
      Parameters:
      val - address of a guint8 pointer variable in which to store the result
      Returns:
      true if successful, false otherwise.
    • getFloat32Be

      public boolean getFloat32Be(Out<Float> val)
      Read a 32 bit big endian floating point value into val and update the current position.
      Parameters:
      val - Pointer to a gfloat to store the result
      Returns:
      true if successful, false otherwise.
    • getFloat32Le

      public boolean getFloat32Le(Out<Float> val)
      Read a 32 bit little endian floating point value into val and update the current position.
      Parameters:
      val - Pointer to a gfloat to store the result
      Returns:
      true if successful, false otherwise.
    • getFloat64Be

      public boolean getFloat64Be(Out<Double> val)
      Read a 64 bit big endian floating point value into val and update the current position.
      Parameters:
      val - Pointer to a gdouble to store the result
      Returns:
      true if successful, false otherwise.
    • getFloat64Le

      public boolean getFloat64Le(Out<Double> val)
      Read a 64 bit little endian floating point value into val and update the current position.
      Parameters:
      val - Pointer to a gdouble to store the result
      Returns:
      true if successful, false otherwise.
    • getInt16Be

      public boolean getInt16Be(Out<Short> val)
      Read a signed 16 bit big endian integer into val and update the current position.
      Parameters:
      val - Pointer to a gint16 to store the result
      Returns:
      true if successful, false otherwise.
    • getInt16Le

      public boolean getInt16Le(Out<Short> val)
      Read a signed 16 bit little endian integer into val and update the current position.
      Parameters:
      val - Pointer to a gint16 to store the result
      Returns:
      true if successful, false otherwise.
    • getInt24Be

      public boolean getInt24Be(Out<Integer> val)
      Read a signed 24 bit big endian integer into val and update the current position.
      Parameters:
      val - Pointer to a gint32 to store the result
      Returns:
      true if successful, false otherwise.
    • getInt24Le

      public boolean getInt24Le(Out<Integer> val)
      Read a signed 24 bit little endian integer into val and update the current position.
      Parameters:
      val - Pointer to a gint32 to store the result
      Returns:
      true if successful, false otherwise.
    • getInt32Be

      public boolean getInt32Be(Out<Integer> val)
      Read a signed 32 bit big endian integer into val and update the current position.
      Parameters:
      val - Pointer to a gint32 to store the result
      Returns:
      true if successful, false otherwise.
    • getInt32Le

      public boolean getInt32Le(Out<Integer> val)
      Read a signed 32 bit little endian integer into val and update the current position.
      Parameters:
      val - Pointer to a gint32 to store the result
      Returns:
      true if successful, false otherwise.
    • getInt64Be

      public boolean getInt64Be(Out<Long> val)
      Read a signed 64 bit big endian integer into val and update the current position.
      Parameters:
      val - Pointer to a gint64 to store the result
      Returns:
      true if successful, false otherwise.
    • getInt64Le

      public boolean getInt64Le(Out<Long> val)
      Read a signed 64 bit little endian integer into val and update the current position.
      Parameters:
      val - Pointer to a gint64 to store the result
      Returns:
      true if successful, false otherwise.
    • getInt8

      public boolean getInt8(Out<Byte> val)
      Read a signed 8 bit integer into val and update the current position.
      Parameters:
      val - Pointer to a gint8 to store the result
      Returns:
      true if successful, false otherwise.
    • getPos

      public int getPos()
      Returns the current position of a GstByteReader instance in bytes.
      Returns:
      The current position of this ByteReader in bytes.
    • getRemaining

      public int getRemaining()
      Returns the remaining number of bytes of a GstByteReader instance.
      Returns:
      The remaining number of bytes of this ByteReader instance.
    • getSize

      public int getSize()
      Returns the total number of bytes of a GstByteReader instance.
      Returns:
      The total number of bytes of this ByteReader instance.
    • getStringUtf8

      public boolean getStringUtf8(@Nullable Out<String[]> str)

      Returns a constant pointer to the current data position if there is a NUL-terminated string in the data (this could be just a NUL terminator), advancing the current position to the byte after the string. This will work for any NUL-terminated string with a character width of 8 bits, so ASCII, UTF-8, ISO-8859-N etc.

      No input checking for valid UTF-8 is done.

      This function will fail if no NUL-terminator was found in in the data.

      Parameters:
      str - address of a gchar pointer variable in which to store the result
      Returns:
      true if a string could be found, false otherwise.
    • getSubReader

      public boolean getSubReader(ByteReader subReader, int size)

      Initializes a GstByteReader sub-reader instance to contain size bytes of data from the current position of reader. This is useful to read chunked formats and make sure that one doesn't read beyond the size of the sub-chunk.

      Unlike gst_byte_reader_peek_sub_reader(), this function also modifies the position of this ByteReader and moves it forward by size bytes.

      Parameters:
      subReader - a GstByteReader instance to initialize as sub-reader
      size - size of subReader in bytes
      Returns:
      FALSE on error or if this ByteReader does not contain size more bytes from the current position, and otherwise TRUE
      Since:
      1.6
    • getUint16Be

      public boolean getUint16Be(Out<Short> val)
      Read an unsigned 16 bit big endian integer into val and update the current position.
      Parameters:
      val - Pointer to a guint16 to store the result
      Returns:
      true if successful, false otherwise.
    • getUint16Le

      public boolean getUint16Le(Out<Short> val)
      Read an unsigned 16 bit little endian integer into val and update the current position.
      Parameters:
      val - Pointer to a guint16 to store the result
      Returns:
      true if successful, false otherwise.
    • getUint24Be

      public boolean getUint24Be(Out<Integer> val)
      Read an unsigned 24 bit big endian integer into val and update the current position.
      Parameters:
      val - Pointer to a guint32 to store the result
      Returns:
      true if successful, false otherwise.
    • getUint24Le

      public boolean getUint24Le(Out<Integer> val)
      Read an unsigned 24 bit little endian integer into val and update the current position.
      Parameters:
      val - Pointer to a guint32 to store the result
      Returns:
      true if successful, false otherwise.
    • getUint32Be

      public boolean getUint32Be(Out<Integer> val)
      Read an unsigned 32 bit big endian integer into val and update the current position.
      Parameters:
      val - Pointer to a guint32 to store the result
      Returns:
      true if successful, false otherwise.
    • getUint32Le

      public boolean getUint32Le(Out<Integer> val)
      Read an unsigned 32 bit little endian integer into val and update the current position.
      Parameters:
      val - Pointer to a guint32 to store the result
      Returns:
      true if successful, false otherwise.
    • getUint64Be

      public boolean getUint64Be(Out<Long> val)
      Read an unsigned 64 bit big endian integer into val and update the current position.
      Parameters:
      val - Pointer to a guint64 to store the result
      Returns:
      true if successful, false otherwise.
    • getUint64Le

      public boolean getUint64Le(Out<Long> val)
      Read an unsigned 64 bit little endian integer into val and update the current position.
      Parameters:
      val - Pointer to a guint64 to store the result
      Returns:
      true if successful, false otherwise.
    • getUint8

      public boolean getUint8(Out<Byte> val)
      Read an unsigned 8 bit integer into val and update the current position.
      Parameters:
      val - Pointer to a guint8 to store the result
      Returns:
      true if successful, false otherwise.
    • init

      public void init(@Nullable byte @Nullable [] data)
      Initializes a GstByteReader instance to read from data. This function can be called on already initialized instances.
      Parameters:
      data - data from which the GstByteReader should read
    • maskedScanUint32

      public int maskedScanUint32(int mask, int pattern, int offset, int size)

      Scan for pattern pattern with applied mask mask in the byte reader data, starting from offset offset relative to the current position.

      The bytes in pattern and mask are interpreted left-to-right, regardless of endianness. All four bytes of the pattern must be present in the byte reader data for it to match, even if the first or last bytes are masked out.

      It is an error to call this function without making sure that there is enough data (offset+size bytes) in the byte reader.

      Parameters:
      mask - mask to apply to data before matching against pattern
      pattern - pattern to match (after mask is applied)
      offset - offset from which to start scanning, relative to the current position
      size - number of bytes to scan from offset
      Returns:

      offset of the first match, or -1 if no match was found.

      Example:

      // Assume the reader contains 0x00 0x01 0x02 ... 0xfe 0xff
      
      gst_byte_reader_masked_scan_uint32 (reader, 0xffffffff, 0x00010203, 0, 256);
      // -> returns 0
      gst_byte_reader_masked_scan_uint32 (reader, 0xffffffff, 0x00010203, 1, 255);
      // -> returns -1
      gst_byte_reader_masked_scan_uint32 (reader, 0xffffffff, 0x01020304, 1, 255);
      // -> returns 1
      gst_byte_reader_masked_scan_uint32 (reader, 0xffff, 0x0001, 0, 256);
      // -> returns -1
      gst_byte_reader_masked_scan_uint32 (reader, 0xffff, 0x0203, 0, 256);
      // -> returns 0
      gst_byte_reader_masked_scan_uint32 (reader, 0xffff0000, 0x02030000, 0, 256);
      // -> returns 2
      gst_byte_reader_masked_scan_uint32 (reader, 0xffff0000, 0x02030000, 0, 4);
      // -> returns -1
      
    • maskedScanUint32Peek

      public int maskedScanUint32Peek(int mask, int pattern, int offset, int size, Out<Integer> value)

      Scan for pattern pattern with applied mask mask in the byte reader data, starting from offset offset relative to the current position.

      The bytes in pattern and mask are interpreted left-to-right, regardless of endianness. All four bytes of the pattern must be present in the byte reader data for it to match, even if the first or last bytes are masked out.

      It is an error to call this function without making sure that there is enough data (offset+size bytes) in the byte reader.

      Parameters:
      mask - mask to apply to data before matching against pattern
      pattern - pattern to match (after mask is applied)
      offset - offset from which to start scanning, relative to the current position
      size - number of bytes to scan from offset
      value - pointer to uint32 to return matching data
      Returns:
      offset of the first match, or -1 if no match was found.
      Since:
      1.6
    • peekData

      public boolean peekData(@Nullable Out<byte[]> val)
      Returns a constant pointer to the current data position if at least size bytes are left and keeps the current position.
      Parameters:
      val - address of a guint8 pointer variable in which to store the result
      Returns:
      true if successful, false otherwise.
    • peekFloat32Be

      public boolean peekFloat32Be(Out<Float> val)
      Read a 32 bit big endian floating point value into val but keep the current position.
      Parameters:
      val - Pointer to a gfloat to store the result
      Returns:
      true if successful, false otherwise.
    • peekFloat32Le

      public boolean peekFloat32Le(Out<Float> val)
      Read a 32 bit little endian floating point value into val but keep the current position.
      Parameters:
      val - Pointer to a gfloat to store the result
      Returns:
      true if successful, false otherwise.
    • peekFloat64Be

      public boolean peekFloat64Be(Out<Double> val)
      Read a 64 bit big endian floating point value into val but keep the current position.
      Parameters:
      val - Pointer to a gdouble to store the result
      Returns:
      true if successful, false otherwise.
    • peekFloat64Le

      public boolean peekFloat64Le(Out<Double> val)
      Read a 64 bit little endian floating point value into val but keep the current position.
      Parameters:
      val - Pointer to a gdouble to store the result
      Returns:
      true if successful, false otherwise.
    • peekInt16Be

      public boolean peekInt16Be(Out<Short> val)
      Read a signed 16 bit big endian integer into val but keep the current position.
      Parameters:
      val - Pointer to a gint16 to store the result
      Returns:
      true if successful, false otherwise.
    • peekInt16Le

      public boolean peekInt16Le(Out<Short> val)
      Read a signed 16 bit little endian integer into val but keep the current position.
      Parameters:
      val - Pointer to a gint16 to store the result
      Returns:
      true if successful, false otherwise.
    • peekInt24Be

      public boolean peekInt24Be(Out<Integer> val)
      Read a signed 24 bit big endian integer into val but keep the current position.
      Parameters:
      val - Pointer to a gint32 to store the result
      Returns:
      true if successful, false otherwise.
    • peekInt24Le

      public boolean peekInt24Le(Out<Integer> val)
      Read a signed 24 bit little endian integer into val but keep the current position.
      Parameters:
      val - Pointer to a gint32 to store the result
      Returns:
      true if successful, false otherwise.
    • peekInt32Be

      public boolean peekInt32Be(Out<Integer> val)
      Read a signed 32 bit big endian integer into val but keep the current position.
      Parameters:
      val - Pointer to a gint32 to store the result
      Returns:
      true if successful, false otherwise.
    • peekInt32Le

      public boolean peekInt32Le(Out<Integer> val)
      Read a signed 32 bit little endian integer into val but keep the current position.
      Parameters:
      val - Pointer to a gint32 to store the result
      Returns:
      true if successful, false otherwise.
    • peekInt64Be

      public boolean peekInt64Be(Out<Long> val)
      Read a signed 64 bit big endian integer into val but keep the current position.
      Parameters:
      val - Pointer to a gint64 to store the result
      Returns:
      true if successful, false otherwise.
    • peekInt64Le

      public boolean peekInt64Le(Out<Long> val)
      Read a signed 64 bit little endian integer into val but keep the current position.
      Parameters:
      val - Pointer to a gint64 to store the result
      Returns:
      true if successful, false otherwise.
    • peekInt8

      public boolean peekInt8(Out<Byte> val)
      Read a signed 8 bit integer into val but keep the current position.
      Parameters:
      val - Pointer to a gint8 to store the result
      Returns:
      true if successful, false otherwise.
    • peekStringUtf8

      public boolean peekStringUtf8(@Nullable Out<String[]> str)

      Returns a constant pointer to the current data position if there is a NUL-terminated string in the data (this could be just a NUL terminator). The current position will be maintained. This will work for any NUL-terminated string with a character width of 8 bits, so ASCII, UTF-8, ISO-8859-N etc.

      No input checking for valid UTF-8 is done.

      This function will fail if no NUL-terminator was found in in the data.

      Parameters:
      str - address of a gchar pointer variable in which to store the result
      Returns:
      true if a string could be skipped, false otherwise.
    • peekSubReader

      public boolean peekSubReader(ByteReader subReader, int size)

      Initializes a GstByteReader sub-reader instance to contain size bytes of data from the current position of reader. This is useful to read chunked formats and make sure that one doesn't read beyond the size of the sub-chunk.

      Unlike gst_byte_reader_get_sub_reader(), this function does not modify the current position of reader.

      Parameters:
      subReader - a GstByteReader instance to initialize as sub-reader
      size - size of subReader in bytes
      Returns:
      FALSE on error or if this ByteReader does not contain size more bytes from the current position, and otherwise TRUE
      Since:
      1.6
    • peekUint16Be

      public boolean peekUint16Be(Out<Short> val)
      Read an unsigned 16 bit big endian integer into val but keep the current position.
      Parameters:
      val - Pointer to a guint16 to store the result
      Returns:
      true if successful, false otherwise.
    • peekUint16Le

      public boolean peekUint16Le(Out<Short> val)
      Read an unsigned 16 bit little endian integer into val but keep the current position.
      Parameters:
      val - Pointer to a guint16 to store the result
      Returns:
      true if successful, false otherwise.
    • peekUint24Be

      public boolean peekUint24Be(Out<Integer> val)
      Read an unsigned 24 bit big endian integer into val but keep the current position.
      Parameters:
      val - Pointer to a guint32 to store the result
      Returns:
      true if successful, false otherwise.
    • peekUint24Le

      public boolean peekUint24Le(Out<Integer> val)
      Read an unsigned 24 bit little endian integer into val but keep the current position.
      Parameters:
      val - Pointer to a guint32 to store the result
      Returns:
      true if successful, false otherwise.
    • peekUint32Be

      public boolean peekUint32Be(Out<Integer> val)
      Read an unsigned 32 bit big endian integer into val but keep the current position.
      Parameters:
      val - Pointer to a guint32 to store the result
      Returns:
      true if successful, false otherwise.
    • peekUint32Le

      public boolean peekUint32Le(Out<Integer> val)
      Read an unsigned 32 bit little endian integer into val but keep the current position.
      Parameters:
      val - Pointer to a guint32 to store the result
      Returns:
      true if successful, false otherwise.
    • peekUint64Be

      public boolean peekUint64Be(Out<Long> val)
      Read an unsigned 64 bit big endian integer into val but keep the current position.
      Parameters:
      val - Pointer to a guint64 to store the result
      Returns:
      true if successful, false otherwise.
    • peekUint64Le

      public boolean peekUint64Le(Out<Long> val)
      Read an unsigned 64 bit little endian integer into val but keep the current position.
      Parameters:
      val - Pointer to a guint64 to store the result
      Returns:
      true if successful, false otherwise.
    • peekUint8

      public boolean peekUint8(Out<Byte> val)
      Read an unsigned 8 bit integer into val but keep the current position.
      Parameters:
      val - Pointer to a guint8 to store the result
      Returns:
      true if successful, false otherwise.
    • setPos

      public boolean setPos(int pos)
      Sets the new position of a GstByteReader instance to pos in bytes.
      Parameters:
      pos - The new position in bytes
      Returns:
      true if the position could be set successfully, false otherwise.
    • skip

      public boolean skip(int nbytes)
      Skips nbytes bytes of the GstByteReader instance.
      Parameters:
      nbytes - the number of bytes to skip
      Returns:
      true if nbytes bytes could be skipped, false otherwise.
    • skipStringUtf16

      public boolean skipStringUtf16()

      Skips a NUL-terminated UTF-16 string in the GstByteReader instance, advancing the current position to the byte after the string.

      No input checking for valid UTF-16 is done.

      This function will fail if no NUL-terminator was found in in the data.

      Returns:
      true if a string could be skipped, false otherwise.
    • skipStringUtf32

      public boolean skipStringUtf32()

      Skips a NUL-terminated UTF-32 string in the GstByteReader instance, advancing the current position to the byte after the string.

      No input checking for valid UTF-32 is done.

      This function will fail if no NUL-terminator was found in in the data.

      Returns:
      true if a string could be skipped, false otherwise.
    • skipStringUtf8

      public boolean skipStringUtf8()

      Skips a NUL-terminated string in the GstByteReader instance, advancing the current position to the byte after the string. This will work for any NUL-terminated string with a character width of 8 bits, so ASCII, UTF-8, ISO-8859-N etc. No input checking for valid UTF-8 is done.

      This function will fail if no NUL-terminator was found in in the data.

      Returns:
      true if a string could be skipped, false otherwise.