|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectSystem.IO.BinaryReader
public class BinaryReader
Reads primitive data types as binary values in a specific encoding.
Constructor Summary | |
---|---|
BinaryReader(Stream input)
Initializes a new instance of the BinaryReader class based on the supplied stream and using UTF-8 encoding. |
|
BinaryReader(Stream input,
java.lang.String encoding)
Initializes a new instance of the BinaryReader class based on the supplied stream and a specific character encoding. |
Method Summary | |
---|---|
void |
Close()
Closes the current reader and the underlying stream. |
void |
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. |
protected void |
Dispose(boolean disposing)
Releases the unmanaged resources used by the BinaryReader and optionally releases the managed resources. |
protected void |
FillBuffer(int numBytes)
Fills the internal buffer with the specified number of bytes read from the stream. |
Stream |
getBaseStream()
|
int |
PeekChar()
|
int |
Read()
Reads characters from the underlying stream and advances the current position of the stream in accordance with the Encoding used and the specific character being read from the stream. |
int |
Read(byte[] buffer,
int index,
int count)
|
int |
Read(char[] buffer,
int index,
int count)
|
protected int |
Read7BitEncodedInt()
|
boolean |
ReadBoolean()
Reads a Boolean value from the current stream and advances the current position of the stream by one byte. |
byte |
ReadByte()
|
byte[] |
ReadBytes(int count)
|
char |
ReadChar()
|
char[] |
ReadChars(int count)
|
double |
ReadDouble()
|
short |
ReadInt16()
|
int |
ReadInt32()
|
long |
ReadInt64()
|
float |
ReadSingle()
|
java.lang.String |
ReadString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public BinaryReader(Stream input)
input
- A stream.
ArgumentException
- The stream does not support reading, the stream is null, or the stream is already closed.public BinaryReader(Stream input, java.lang.String encoding)
input
- The supplied stream.encoding
- The character encoding.
ArgumentNullException
- input, or encoding is null.
ArgumentException
- The stream does not support reading, or the stream is already closed.Method Detail |
---|
public Stream getBaseStream()
public void Close()
public void Dispose()
IDisposable
Dispose
in interface IDisposable
protected void Dispose(boolean disposing)
disposing
- true to release both managed and unmanaged resources; false to release only unmanaged resources.protected void FillBuffer(int numBytes)
numBytes
- The number of bytes to be read.
EndOfStreamException
- The end of the stream is reached before numBytes could be read.
IOException
- An I/O error occurs.public int PeekChar()
IOException
- An I/O error occurs.public int Read()
ObjectDisposedException
- The stream is closed.
IOException
- An I/O error occurs.public int Read(byte[] buffer, int index, int count)
public int Read(char[] buffer, int index, int count)
buffer
- index
- count
-
protected int Read7BitEncodedInt()
public boolean ReadBoolean()
ObjectDisposedException
- The stream is closed.
IOException
- An I/O error occurs.
EndOfStreamException
- The end of the stream is reached.public byte ReadByte()
public byte[] ReadBytes(int count)
public char ReadChar()
public char[] ReadChars(int count)
public double ReadDouble()
public short ReadInt16()
public int ReadInt32()
public long ReadInt64()
public float ReadSingle()
public java.lang.String ReadString()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |