Package com.github.kokorin.jaffree.nut
Class NutOutputStream
java.lang.Object
com.github.kokorin.jaffree.nut.NutOutputStream
- All Implemented Interfaces:
AutoCloseable
NutOutputStream implements core NUT write operations.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()voidflush()Flushes underlyingOutputStream.longReturns current position (offset) in bytes.voidResets NUT CRC32.voidwriteByte(int value) Writes f(n) type (n fixed bits in big-endian order).voidwriteBytes(byte[] data) Writes raw bytes.voidWrites NUT CRC32.voidwriteCString(String data) Writes null-terminated string.voidwriteInt(long value) Writes f(n) type (n fixed bits in big-endian order).voidwriteLong(long value) Writes f(n) type (n fixed bits in big-endian order).voidwriteSignedValue(long signed) Writes s type (variable length value, signed).voidwriteTimestamp(int timeBaseCount, Timestamp timestamp) Writes t type (v coded universal timestamp).voidwriteValue(long value) Writes v type (variable length value, unsigned).voidwriteVariableBytes(byte[] data) Writes vb type (variable length binary data or string).voidwriteVariablesString(String data) Writes vb type (variable length binary data or string).
-
Constructor Details
-
NutOutputStream
CreatesNutOutputStream.- Parameters:
output- output stream
-
-
Method Details
-
writeValue
Writes v type (variable length value, unsigned).- Parameters:
value- value- Throws:
IOException- if any IO error
-
writeSignedValue
Writes s type (variable length value, signed).- Parameters:
signed- signed value- Throws:
IOException- if any IO error
-
writeLong
Writes f(n) type (n fixed bits in big-endian order). n == 64- Parameters:
value- value- Throws:
IOException- if any IO error
-
writeInt
Writes f(n) type (n fixed bits in big-endian order). n == 32- Parameters:
value- value- Throws:
IOException- if any IO error
-
writeByte
Writes f(n) type (n fixed bits in big-endian order). n == 8- Parameters:
value- value- Throws:
IOException- if any IO error
-
writeVariablesString
Writes vb type (variable length binary data or string).- Parameters:
data- string data- Throws:
IOException- if any IO error
-
writeCString
Writes null-terminated string.- Parameters:
data- string data- Throws:
IOException- if any IO error
-
writeVariableBytes
Writes vb type (variable length binary data or string).- Parameters:
data- bytes- Throws:
IOException- if any IO error
-
writeTimestamp
Writes t type (v coded universal timestamp).- Parameters:
timeBaseCount- time base counttimestamp- timestamp- Throws:
IOException- if any IO error
-
writeBytes
Writes raw bytes.- Parameters:
data- bytes- Throws:
IOException- if any IO error
-
resetCrc32
public void resetCrc32()Resets NUT CRC32. -
writeCrc32
Writes NUT CRC32.- Throws:
IOException- if any IO error
-
getPosition
public long getPosition()Returns current position (offset) in bytes.- Returns:
- current position
-
flush
Flushes underlyingOutputStream.- Throws:
IOException- if any IO error
-
close
- Specified by:
closein interfaceAutoCloseable- Throws:
Exception
-