com.io7m.smfj.format.binary

## Interface SMFBDataStreamReaderType

- All Known Implementing Classes:
    SMFBDataStreamReader

      public interface SMFBDataStreamReaderType

  A stream reader.

- - ### Method Summary

    All Methods Instance Methods Abstract Methods Default Methods
    Modifier and Type | Method and Description
    --- | ---
    `long` | `position()`
    `com.io7m.jlexing.core.LexicalPosition<URI>` | `positionLexical()`
    `void` | `readBytes(Optional<String> name, byte[] b)` Read exactly `b.length` octets from the stream, raising an error if too few octets are available.
    `double` | `readF16(Optional<String> name)` Read an IEEE754-binary16 value from the stream.
    `double` | `readF32(Optional<String> name)` Read an IEEE754-binary32 value from the stream.
    `double` | `readF64(Optional<String> name)` Read an IEEE754-binary64 value from the stream.
    `long` | `readS16(Optional<String> name)` Read a signed 16-bit value from the stream.
    `long` | `readS32(Optional<String> name)` Read a signed 32-bit value from the stream.
    `long` | `readS64(Optional<String> name)` Read a signed 64-bit value from the stream.
    `long` | `readS8(Optional<String> name)` Read a signed 8-bit value from the stream.
    `long` | `readU16(Optional<String> name)` Read an unsigned 16-bit value from the stream.
    `long` | `readU32(Optional<String> name)` Read an unsigned 32-bit value from the stream.
    `long` | `readU64(Optional<String> name)` Read an unsigned 64-bit value from the stream.
    `long` | `readU8(Optional<String> name)` Read an unsigned 8-bit value from the stream.
    `void` | `skip(long count)` Skip ahead `count` octets in the stream.
    `default void` | `skipTo(long offset)` Skip to the given offset.
    `URI` | `uri()`
    `SMFBDataStreamReaderType` | `withBounds(long size)` Create a new view of this reader that is only allowed to read `size` more octets from the current stream.

- - ### Method Detail

    - #### uri

          URI uri()

      Returns:
        The URI referred to by the stream

    - #### readBytes

          void readBytes(Optional<String> name,
                         byte[] b)
                  throws IOException

      Read exactly `b.length` octets from the stream, raising an error if too few octets are available.
      Parameters:
        `name` - A field name for precise error reporting
        `b` - The output octets
      Throws:
        `IOException` - On I/O errors

    - #### position

          long position()

      Returns:
        The current stream position; the number of octets consumed so far

    - #### readU8

          long readU8(Optional<String> name)
               throws IOException

      Read an unsigned 8-bit value from the stream.
      Parameters:
        `name` - A field name for precise error reporting
      Returns:
        The read value
      Throws:
        `IOException` - On I/O errors

    - #### readS8

          long readS8(Optional<String> name)
               throws IOException

      Read a signed 8-bit value from the stream.
      Parameters:
        `name` - A field name for precise error reporting
      Returns:
        The read value
      Throws:
        `IOException` - On I/O errors

    - #### readU16

          long readU16(Optional<String> name)
                throws IOException

      Read an unsigned 16-bit value from the stream.
      Parameters:
        `name` - A field name for precise error reporting
      Returns:
        The read value
      Throws:
        `IOException` - On I/O errors

    - #### readS16

          long readS16(Optional<String> name)
                throws IOException

      Read a signed 16-bit value from the stream.
      Parameters:
        `name` - A field name for precise error reporting
      Returns:
        The read value
      Throws:
        `IOException` - On I/O errors

    - #### readU32

          long readU32(Optional<String> name)
                throws IOException

      Read an unsigned 32-bit value from the stream.
      Parameters:
        `name` - A field name for precise error reporting
      Returns:
        The read value
      Throws:
        `IOException` - On I/O errors

    - #### readS32

          long readS32(Optional<String> name)
                throws IOException

      Read a signed 32-bit value from the stream.
      Parameters:
        `name` - A field name for precise error reporting
      Returns:
        The read value
      Throws:
        `IOException` - On I/O errors

    - #### readU64

          long readU64(Optional<String> name)
                throws IOException

      Read an unsigned 64-bit value from the stream.
      Parameters:
        `name` - A field name for precise error reporting
      Returns:
        The read value
      Throws:
        `IOException` - On I/O errors

    - #### readS64

          long readS64(Optional<String> name)
                throws IOException

      Read a signed 64-bit value from the stream.
      Parameters:
        `name` - A field name for precise error reporting
      Returns:
        The read value
      Throws:
        `IOException` - On I/O errors

    - #### readF16

          double readF16(Optional<String> name)
                  throws IOException

      Read an IEEE754-binary16 value from the stream.
      Parameters:
        `name` - A field name for precise error reporting
      Returns:
        The read value
      Throws:
        `IOException` - On I/O errors

    - #### readF32

          double readF32(Optional<String> name)
                  throws IOException

      Read an IEEE754-binary32 value from the stream.
      Parameters:
        `name` - A field name for precise error reporting
      Returns:
        The read value
      Throws:
        `IOException` - On I/O errors

    - #### readF64

          double readF64(Optional<String> name)
                  throws IOException

      Read an IEEE754-binary64 value from the stream.
      Parameters:
        `name` - A field name for precise error reporting
      Returns:
        The read value
      Throws:
        `IOException` - On I/O errors

    - #### skip

          void skip(long count)
             throws IOException

      Skip ahead `count` octets in the stream.
      Parameters:
        `count` - The number of octets to skip
      Throws:
        `IOException` - On I/O errors

    - #### positionLexical

          com.io7m.jlexing.core.LexicalPosition<URI> positionLexical()

      Returns:
        The current stream position; the number of octets consumed so far

    - #### withBounds

          SMFBDataStreamReaderType withBounds(long size)

      Create a new view of this reader that is only allowed to read `size` more octets from the current stream. Reading from the newly created reader will advance the position of the current reader as well.
      Parameters:
        `size` - The maximum number of octets that can be read
      Returns:
        A new reader

    - #### skipTo

          default void skipTo(long offset)
                       throws IOException

      Skip to the given offset. Has no effect if the writer has already passed the given offset.
      Parameters:
        `offset` - The offset
      Throws:
        `IOException` - On I/O errors

Copyright © 2017 <code@io7m.com> http://io7m.com