Class NutOutputStream

java.lang.Object
com.github.kokorin.jaffree.nut.NutOutputStream
All Implemented Interfaces:
AutoCloseable

public class NutOutputStream extends Object implements AutoCloseable
NutOutputStream implements core NUT write operations.
  • Constructor Details

  • Method Details

    • writeValue

      public void writeValue(long value) throws IOException
      Writes v type (variable length value, unsigned).
      Parameters:
      value - value
      Throws:
      IOException - if any IO error
    • writeSignedValue

      public void writeSignedValue(long signed) throws IOException
      Writes s type (variable length value, signed).
      Parameters:
      signed - signed value
      Throws:
      IOException - if any IO error
    • writeLong

      public void writeLong(long value) throws IOException
      Writes f(n) type (n fixed bits in big-endian order). n == 64
      Parameters:
      value - value
      Throws:
      IOException - if any IO error
    • writeInt

      public void writeInt(long value) throws IOException
      Writes f(n) type (n fixed bits in big-endian order). n == 32
      Parameters:
      value - value
      Throws:
      IOException - if any IO error
    • writeByte

      public void writeByte(int value) throws IOException
      Writes f(n) type (n fixed bits in big-endian order). n == 8
      Parameters:
      value - value
      Throws:
      IOException - if any IO error
    • writeVariablesString

      public void writeVariablesString(String data) throws IOException
      Writes vb type (variable length binary data or string).
      Parameters:
      data - string data
      Throws:
      IOException - if any IO error
    • writeCString

      public void writeCString(String data) throws IOException
      Writes null-terminated string.
      Parameters:
      data - string data
      Throws:
      IOException - if any IO error
    • writeVariableBytes

      public void writeVariableBytes(byte[] data) throws IOException
      Writes vb type (variable length binary data or string).
      Parameters:
      data - bytes
      Throws:
      IOException - if any IO error
    • writeTimestamp

      public void writeTimestamp(int timeBaseCount, Timestamp timestamp) throws IOException
      Writes t type (v coded universal timestamp).
      Parameters:
      timeBaseCount - time base count
      timestamp - timestamp
      Throws:
      IOException - if any IO error
    • writeBytes

      public void writeBytes(byte[] data) throws IOException
      Writes raw bytes.
      Parameters:
      data - bytes
      Throws:
      IOException - if any IO error
    • resetCrc32

      public void resetCrc32()
      Resets NUT CRC32.
    • writeCrc32

      public void writeCrc32() throws IOException
      Writes NUT CRC32.
      Throws:
      IOException - if any IO error
    • getPosition

      public long getPosition()
      Returns current position (offset) in bytes.
      Returns:
      current position
    • flush

      public void flush() throws IOException
      Flushes underlying OutputStream.
      Throws:
      IOException - if any IO error
    • close

      public void close() throws Exception
      Specified by:
      close in interface AutoCloseable
      Throws:
      Exception