java.lang.Object
java.io.InputStream
io.ByteReader
- All Implemented Interfaces:
Closeable,AutoCloseable
public class ByteReader extends InputStream
-
Constructor Summary
Constructors Constructor Description ByteReader(InputStream in) -
Method Summary
Modifier and Type Method Description ByteReaderchangeEndiannes()voidclose()intgetPosition()intread()intread(byte[] b, int off, int len)longread2bytes()longread3bytes()longread4bytes()longread5bytes()longread6bytes()longread7bytes()longread8bytes()StringreadString(int sz)reads 0-terminated string in default code pageStringreadUnicodeString()reads unicode string that has 2 bytes at start indicates length of stringStringreadUnicodeString(int sz)reads 0-terminated string in unicodebooleanseek(int n)Methods inherited from class java.io.InputStream
available, mark, markSupported, nullInputStream, read, readAllBytes, readNBytes, readNBytes, reset, skip, skipNBytes, transferTo
-
Constructor Details
-
ByteReader
-
-
Method Details
-
getPosition
public int getPosition() -
changeEndiannes
-
seek
- Throws:
IOException
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classInputStream- Throws:
IOException
-
read
- Overrides:
readin classInputStream- Throws:
IOException
-
read
- Specified by:
readin classInputStream- Throws:
IOException
-
read2bytes
- Throws:
IOException
-
read3bytes
- Throws:
IOException
-
read4bytes
- Throws:
IOException
-
read5bytes
- Throws:
IOException
-
read6bytes
- Throws:
IOException
-
read7bytes
- Throws:
IOException
-
read8bytes
- Throws:
IOException
-
readString
reads 0-terminated string in default code page- Parameters:
sz- - maximum size in bytes- Throws:
IOException
-
readUnicodeString
reads 0-terminated string in unicode- Parameters:
sz- - maximum size in charcters- Throws:
IOException
-
readUnicodeString
reads unicode string that has 2 bytes at start indicates length of string- Throws:
IOException
-