Class Endian
java.lang.Object
org.archive.io.Endian
Reads integers stored in big or little endian streams.
- Author:
- pjack
-
Method Summary
Modifier and TypeMethodDescriptionstatic charbigChar(InputStream input) Reads the next big-endian unsigned 16 bit integer from the given stream.static intbigInt(InputStream input) Reads the next big-endian signed 32-bit integer from the given stream.static charlittleChar(InputStream input) Reads the next little-endian unsigned 16 bit integer from the given stream.static intlittleInt(InputStream input) Reads the next little-endian signed 32-bit integer from the given stream.static shortlittleShort(InputStream input) Reads the next little-endian signed 16-bit integer from the given stream.
-
Method Details
-
littleChar
Reads the next little-endian unsigned 16 bit integer from the given stream.- Parameters:
input- the input stream to read from- Returns:
- the next 16-bit little-endian integer
- Throws:
IOException- if an IO error occurs
-
littleShort
Reads the next little-endian signed 16-bit integer from the given stream.- Parameters:
input- the input stream to read from- Returns:
- the next 16-bit little-endian integer
- Throws:
IOException- if an IO error occurs
-
littleInt
Reads the next little-endian signed 32-bit integer from the given stream.- Parameters:
input- the input stream to read from- Returns:
- the next 32-bit little-endian integer
- Throws:
IOException- if an IO error occurs
-
bigChar
Reads the next big-endian unsigned 16 bit integer from the given stream.- Parameters:
input- the input stream to read from- Returns:
- the next 16-bit big-endian integer
- Throws:
IOException- if an IO error occurs
-
bigInt
Reads the next big-endian signed 32-bit integer from the given stream.- Parameters:
input- the input stream to read from- Returns:
- the next 32-bit big-endian integer
- Throws:
IOException- if an IO error occurs
-