Class LittleEndianOutputStream
java.lang.Object
java.io.OutputStream
java.io.FilterOutputStream
de.inetsoftware.jwebassembly.wasm.LittleEndianOutputStream
- All Implemented Interfaces:
Closeable, Flushable, AutoCloseable
- Direct Known Subclasses:
WasmOutputStream
outputStream with little endian encoding like in Wasm.
-
Field Summary
FieldsFields inherited from class FilterOutputStream
out -
Constructor Summary
ConstructorsConstructorDescriptionCreate a in memory stream.LittleEndianOutputStream(OutputStream output) Create a wrapped stream. -
Method Summary
Modifier and TypeMethodDescriptionvoidreset()Reset the stream.intsize()The count of bytes in the stream.voidwrite(byte[] b, int off, int len) voidwrite(int b) voidwriteInt32(int value) Write a integer little endian (ever 4 bytes)voidwriteTo(OutputStream output) Write the data of this stream to the output.Methods inherited from class FilterOutputStream
close, flush, writeMethods inherited from class OutputStream
nullOutputStream
-
Field Details
-
count
private int count
-
-
Constructor Details
-
LittleEndianOutputStream
public LittleEndianOutputStream()Create a in memory stream. -
LittleEndianOutputStream
Create a wrapped stream.- Parameters:
output- the target of data
-
-
Method Details
-
write
- Overrides:
writein classFilterOutputStream- Throws:
IOException
-
write
- Overrides:
writein classFilterOutputStream- Throws:
IOException
-
writeInt32
Write a integer little endian (ever 4 bytes)- Parameters:
value- the value- Throws:
IOException- if an I/O error occurs.
-
writeTo
Write the data of this stream to the output. Work only for in memory stream.- Parameters:
output- the target- Throws:
IOException- if any I/O error occur
-
size
public int size()The count of bytes in the stream.- Returns:
- the data size
-
reset
public void reset()Reset the stream. Work only for in memory stream.
-