- java.lang.Object
-
- java.io.InputStream
-
- io.ByteReader
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable
public class ByteReader extends java.io.InputStream
-
-
Constructor Summary
Constructors Constructor Description ByteReader(java.io.InputStream in)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ByteReaderchangeEndiannes()voidclose()intgetPosition()intread()intread(byte[] b, int off, int len)longread2bytes()longread3bytes()longread4bytes()longread5bytes()longread6bytes()longread7bytes()longread8bytes()java.lang.StringreadString(int sz)reads 0-terminated string in default code pagejava.lang.StringreadUnicodeString()reads unicode string that has 2 bytes at start indicates length of stringjava.lang.StringreadUnicodeString(int sz)reads 0-terminated string in unicodebooleanseek(int n)
-
-
-
Method Detail
-
getPosition
public int getPosition()
-
changeEndiannes
public ByteReader changeEndiannes()
-
seek
public boolean seek(int n) throws java.io.IOException- Throws:
java.io.IOException
-
close
public void close() throws java.io.IOException- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable- Overrides:
closein classjava.io.InputStream- Throws:
java.io.IOException
-
read
public int read(byte[] b, int off, int len) throws java.io.IOException- Overrides:
readin classjava.io.InputStream- Throws:
java.io.IOException
-
read
public int read() throws java.io.IOException- Specified by:
readin classjava.io.InputStream- Throws:
java.io.IOException
-
read2bytes
public long read2bytes() throws java.io.IOException- Throws:
java.io.IOException
-
read3bytes
public long read3bytes() throws java.io.IOException- Throws:
java.io.IOException
-
read4bytes
public long read4bytes() throws java.io.IOException- Throws:
java.io.IOException
-
read5bytes
public long read5bytes() throws java.io.IOException- Throws:
java.io.IOException
-
read6bytes
public long read6bytes() throws java.io.IOException- Throws:
java.io.IOException
-
read7bytes
public long read7bytes() throws java.io.IOException- Throws:
java.io.IOException
-
read8bytes
public long read8bytes() throws java.io.IOException- Throws:
java.io.IOException
-
readString
public java.lang.String readString(int sz) throws java.io.IOExceptionreads 0-terminated string in default code page- Parameters:
sz- - maximum size in bytes- Throws:
java.io.IOException
-
readUnicodeString
public java.lang.String readUnicodeString(int sz) throws java.io.IOExceptionreads 0-terminated string in unicode- Parameters:
sz- - maximum size in charcters- Throws:
java.io.IOException
-
readUnicodeString
public java.lang.String readUnicodeString() throws java.io.IOExceptionreads unicode string that has 2 bytes at start indicates length of string- Throws:
java.io.IOException
-
-