Is there any way to force DataInputStream to read little-endian data?? Thx
PS. Doing byte-buffer conversions is not very convinient as I'm dealing with C-type structs that have lots of 32-bit and 16-bit members.
Class DataInputStream. A data input stream lets an application read primitive Java data types from an underlying input stream in a machine-independent way. An application uses a data output stream to write data that can later be read by a data input stream.
InputStream in = new DataInputStream(InputStream in); Once you have DataInputStream object in hand, then there is a list of helper methods, which can be used to read the stream or to do other operations on the stream. Sr.No. Reads up to len bytes of data from the input stream into an array of bytes.
Perhaps you can use ByteBuffer
which allows order(ByteOrder.LITTLE_ENDIAN)
After that most of the methods are like DataInputStream
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With