Package com.pnfsoftware.jeb.util.io
Class LEDataOutputStream
java.lang.Object
java.io.OutputStream
java.io.FilterOutputStream
com.pnfsoftware.jeb.util.io.LEDataOutputStream
- All Implemented Interfaces:
Closeable,DataOutput,Flushable,AutoCloseable
Little-endian version of a
DataOutputStream.-
Field Summary
Fields inherited from class java.io.FilterOutputStream
out -
Constructor Summary
ConstructorsConstructorDescriptionCreate a little-endian data output stream. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()intsize()Returns the current value of the counter written , the number of bytes written to this data output stream so far.longvoidwrite(byte[] b) voidwrite(byte[] b, int off, int len) voidwrite(int b) voidwriteBoolean(boolean v) voidwriteByte(int v) voidwriteBytes(String s) Deprecated.voidwriteChar(int v) voidwriteChars(String s) voidwriteDouble(double v) voidwriteFloat(float v) voidwriteInt(int v) voidwriteIntULEB128(int v) Write an unsigned LEB128-encoded 32-bit integer.voidwriteLong(long v) voidwriteLongULEB128(long v) Write an unsigned LEB128-encoded 64-bit integer.voidwriteShort(int v) voidNote: the string counter is stored in big-endian.Methods inherited from class java.io.FilterOutputStream
flushMethods inherited from class java.io.OutputStream
nullOutputStream
-
Constructor Details
-
LEDataOutputStream
Create a little-endian data output stream.- Parameters:
out- wrapped output stream
-
-
Method Details
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classFilterOutputStream- Throws:
IOException
-
size
public int size()Returns the current value of the counter written , the number of bytes written to this data output stream so far. If the counter overflows, it will be wrapped to Integer.MAX_VALUE. To retrieve the actual size, usesizeAsLong().- Returns:
- byte count
-
sizeAsLong
public long sizeAsLong() -
write
- Specified by:
writein interfaceDataOutput- Overrides:
writein classFilterOutputStream- Throws:
IOException
-
write
- Specified by:
writein interfaceDataOutput- Overrides:
writein classFilterOutputStream- Throws:
IOException
-
write
- Specified by:
writein interfaceDataOutput- Overrides:
writein classFilterOutputStream- Throws:
IOException
-
writeBoolean
- Specified by:
writeBooleanin interfaceDataOutput- Throws:
IOException
-
writeByte
- Specified by:
writeBytein interfaceDataOutput- Throws:
IOException
-
writeBytes
Deprecated.Danger: not portable! Uses local system encoding.- Specified by:
writeBytesin interfaceDataOutput- Throws:
IOException
-
writeUTF
Note: the string counter is stored in big-endian.- Specified by:
writeUTFin interfaceDataOutput- Throws:
IOException
-
writeChar
- Specified by:
writeCharin interfaceDataOutput- Throws:
IOException
-
writeChars
- Specified by:
writeCharsin interfaceDataOutput- Throws:
IOException
-
writeInt
- Specified by:
writeIntin interfaceDataOutput- Throws:
IOException
-
writeShort
- Specified by:
writeShortin interfaceDataOutput- Throws:
IOException
-
writeLong
- Specified by:
writeLongin interfaceDataOutput- Throws:
IOException
-
writeFloat
- Specified by:
writeFloatin interfaceDataOutput- Throws:
IOException
-
writeDouble
- Specified by:
writeDoublein interfaceDataOutput- Throws:
IOException
-
writeIntULEB128
Write an unsigned LEB128-encoded 32-bit integer.- Parameters:
v- value to encode- Throws:
IOException- if the output stream cannot be written
-
writeLongULEB128
Write an unsigned LEB128-encoded 64-bit integer.- Parameters:
v- value to encode- Throws:
IOException- if the output stream cannot be written
-