com.io7m.smfj.format.binary

## Class SMFBDataStreamWriter

- java.lang.Object
- - com.io7m.smfj.format.binary.SMFBDataStreamWriter

- All Implemented Interfaces:
    SMFBDataStreamWriterType

      public final class SMFBDataStreamWriter
      extends Object
      implements SMFBDataStreamWriterType

  The default implementation of the `SMFBDataStreamWriterType` interface.

- - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static SMFBDataStreamWriterType` | `create(URI in_uri, OutputStream in_stream)` Create a data stream writer.
    `void` | `pad(long count, byte value)` Insert `count` octets of padding.
    `long` | `position()`
    `void` | `putBytes(byte[] data)` Write the given bytes to the stream.
    `void` | `putF16(double value)` Write an IEEE754-binary16 value to the stream.
    `void` | `putF32(double value)` Write an IEEE754-binary32 value to the stream.
    `void` | `putF64(double value)` Write an IEEE754-binary64 value to the stream.
    `void` | `putS16(long value)` Write a signed 16-bit value to the stream.
    `void` | `putS32(long value)` Write a signed 32-bit value to the stream.
    `void` | `putS64(long value)` Write a signed 64-bit value to the stream.
    `void` | `putS8(long value)` Write a signed 8-bit value to the stream.
    `void` | `putStringPadded(String text, int maximum)` Write a string to the stream in UTF-8 encoding, writing as many 0-bytes as necessary after the string to bring it up to a size of `maximum` octets.
    `void` | `putU16(long value)` Write an unsigned 16-bit value to the stream.
    `void` | `putU32(long value)` Write an unsigned 32-bit value to the stream.
    `void` | `putU64(long value)` Write an unsigned 64-bit value to the stream.
    `void` | `putU8(long value)` Write an unsigned 8-bit value to the stream.
    `URI` | `uri()`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

    - ### Methods inherited from interface com.io7m.smfj.format.binary.SMFBDataStreamWriterType

      `checkAlignment, isAligned, padTo`

- - ### Method Detail

    - #### create

          public static SMFBDataStreamWriterType create(URI in_uri,
                                                        OutputStream in_stream)

      Create a data stream writer.
      Parameters:
        `in_uri` - The uri
        `in_stream` - The stream
      Returns:
        A new data stream writer

    - #### position

          public long position()

      Specified by:
        `position` in interface `SMFBDataStreamWriterType`
      Returns:
        The current stream position; the number of octets written (or skipped) so far

    - #### uri

          public URI uri()

      Specified by:
        `uri` in interface `SMFBDataStreamWriterType`
      Returns:
        The URI referred to by the stream

    - #### putBytes

          public void putBytes(byte[] data)
                        throws IOException

      Description copied from interface: `SMFBDataStreamWriterType`
      Write the given bytes to the stream.
      Specified by:
        `putBytes` in interface `SMFBDataStreamWriterType`
      Parameters:
        `data` - The bytes
      Throws:
        `IOException` - On I/O errors

    - #### putS8

          public void putS8(long value)
                     throws IOException

      Description copied from interface: `SMFBDataStreamWriterType`
      Write a signed 8-bit value to the stream.
      Specified by:
        `putS8` in interface `SMFBDataStreamWriterType`
      Parameters:
        `value` - The value
      Throws:
        `IOException` - On I/O errors

    - #### putU8

          public void putU8(long value)
                     throws IOException

      Description copied from interface: `SMFBDataStreamWriterType`
      Write an unsigned 8-bit value to the stream.
      Specified by:
        `putU8` in interface `SMFBDataStreamWriterType`
      Parameters:
        `value` - The value
      Throws:
        `IOException` - On I/O errors

    - #### putStringPadded

          public void putStringPadded(String text,
                                      int maximum)
                               throws IOException

      Description copied from interface: `SMFBDataStreamWriterType`
      Write a string to the stream in UTF-8 encoding, writing as many 0-bytes as necessary after the string to bring it up to a size of `maximum` octets.
      Specified by:
        `putStringPadded` in interface `SMFBDataStreamWriterType`
      Parameters:
        `text` - The string
        `maximum` - The maximum length
      Throws:
        `IOException` - On I/O errors

    - #### putU16

          public void putU16(long value)
                      throws IOException

      Description copied from interface: `SMFBDataStreamWriterType`
      Write an unsigned 16-bit value to the stream.
      Specified by:
        `putU16` in interface `SMFBDataStreamWriterType`
      Parameters:
        `value` - The value
      Throws:
        `IOException` - On I/O errors

    - #### putU32

          public void putU32(long value)
                      throws IOException

      Description copied from interface: `SMFBDataStreamWriterType`
      Write an unsigned 32-bit value to the stream.
      Specified by:
        `putU32` in interface `SMFBDataStreamWriterType`
      Parameters:
        `value` - The value
      Throws:
        `IOException` - On I/O errors

    - #### putU64

          public void putU64(long value)
                      throws IOException

      Description copied from interface: `SMFBDataStreamWriterType`
      Write an unsigned 64-bit value to the stream.
      Specified by:
        `putU64` in interface `SMFBDataStreamWriterType`
      Parameters:
        `value` - The value
      Throws:
        `IOException` - On I/O errors

    - #### putS16

          public void putS16(long value)
                      throws IOException

      Description copied from interface: `SMFBDataStreamWriterType`
      Write a signed 16-bit value to the stream.
      Specified by:
        `putS16` in interface `SMFBDataStreamWriterType`
      Parameters:
        `value` - The value
      Throws:
        `IOException` - On I/O errors

    - #### putS32

          public void putS32(long value)
                      throws IOException

      Description copied from interface: `SMFBDataStreamWriterType`
      Write a signed 32-bit value to the stream.
      Specified by:
        `putS32` in interface `SMFBDataStreamWriterType`
      Parameters:
        `value` - The value
      Throws:
        `IOException` - On I/O errors

    - #### putS64

          public void putS64(long value)
                      throws IOException

      Description copied from interface: `SMFBDataStreamWriterType`
      Write a signed 64-bit value to the stream.
      Specified by:
        `putS64` in interface `SMFBDataStreamWriterType`
      Parameters:
        `value` - The value
      Throws:
        `IOException` - On I/O errors

    - #### putF16

          public void putF16(double value)
                      throws IOException

      Description copied from interface: `SMFBDataStreamWriterType`
      Write an IEEE754-binary16 value to the stream.
      Specified by:
        `putF16` in interface `SMFBDataStreamWriterType`
      Parameters:
        `value` - The value
      Throws:
        `IOException` - On I/O errors

    - #### putF32

          public void putF32(double value)
                      throws IOException

      Description copied from interface: `SMFBDataStreamWriterType`
      Write an IEEE754-binary32 value to the stream.
      Specified by:
        `putF32` in interface `SMFBDataStreamWriterType`
      Parameters:
        `value` - The value
      Throws:
        `IOException` - On I/O errors

    - #### putF64

          public void putF64(double value)
                      throws IOException

      Description copied from interface: `SMFBDataStreamWriterType`
      Write an IEEE754-binary64 value to the stream.
      Specified by:
        `putF64` in interface `SMFBDataStreamWriterType`
      Parameters:
        `value` - The value
      Throws:
        `IOException` - On I/O errors

    - #### pad

          public void pad(long count,
                          byte value)
                   throws IOException

      Description copied from interface: `SMFBDataStreamWriterType`
      Insert `count` octets of padding.
      Specified by:
        `pad` in interface `SMFBDataStreamWriterType`
      Parameters:
        `count` - The octet count
        `value` - The padding value
      Throws:
        `IOException` - On I/O errors

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