C# Class Fanx.Util.DataReader

DataReader is an implemention of java.io.DataInputStream for .NET.
Inheritance: System.IO.BinaryReader
ファイルを表示 Open project: xored/f4 Class Usage Examples

Public Methods

Method Description
DataReader ( Stream baseStream ) : System

Construct a new DataReader for the given stream.

ReadBoolean ( ) : bool

Reads one input byte and returns true if that byte is nonzero, false if that byte is zero.

ReadChar ( ) : char

Reads and returns one input byte.

Reads an input char and returns the char value

ReadDouble ( ) : double

Reads eight input bytes and returns a double value.

ReadFloat ( ) : float

Reads four input bytes and returns a float value.

ReadFully ( byte b ) : void

Reads some bytes from an input stream and stores them into the buffer array b.

ReadFully ( byte b, int off, int len ) : void

Reads len bytes from an input stream.

ReadInt ( ) : int

Reads four input bytes and returns an int value.

ReadLong ( ) : long

Reads eight input bytes and returns a long value.

ReadShort ( ) : short

Reads two input bytes and returns a short value.

ReadUTF ( ) : string

Reads in a string that has been encoded using a modified UTF-8 format.

ReadUnsignedByte ( ) : int

Reads one input byte, zero-extends it to type int, and returns the result, which is therefore in the range 0 through 255.

ReadUnsignedShort ( ) : int

Reads two input bytes and returns an int value in the range 0 through 65535.

SkipBytes ( int n ) : int

Makes an attempt to skip over n bytes of data from the input stream, discarding the skipped bytes.

Private Methods

Method Description
utfErr ( ) : Exception

Method Details

DataReader() public method

Construct a new DataReader for the given stream.
public DataReader ( Stream baseStream ) : System
baseStream Stream
return System

ReadBoolean() public method

Reads one input byte and returns true if that byte is nonzero, false if that byte is zero.
public ReadBoolean ( ) : bool
return bool

ReadChar() public method

Reads and returns one input byte. Reads an input char and returns the char value
public ReadChar ( ) : char
return char

ReadDouble() public method

Reads eight input bytes and returns a double value.
public ReadDouble ( ) : double
return double

ReadFloat() public method

Reads four input bytes and returns a float value.
public ReadFloat ( ) : float
return float

ReadFully() public method

Reads some bytes from an input stream and stores them into the buffer array b.
public ReadFully ( byte b ) : void
b byte
return void

ReadFully() public method

Reads len bytes from an input stream.
public ReadFully ( byte b, int off, int len ) : void
b byte
off int
len int
return void

ReadInt() public method

Reads four input bytes and returns an int value.
public ReadInt ( ) : int
return int

ReadLong() public method

Reads eight input bytes and returns a long value.
public ReadLong ( ) : long
return long

ReadShort() public method

Reads two input bytes and returns a short value.
public ReadShort ( ) : short
return short

ReadUTF() public method

Reads in a string that has been encoded using a modified UTF-8 format.
public ReadUTF ( ) : string
return string

ReadUnsignedByte() public method

Reads one input byte, zero-extends it to type int, and returns the result, which is therefore in the range 0 through 255.
public ReadUnsignedByte ( ) : int
return int

ReadUnsignedShort() public method

Reads two input bytes and returns an int value in the range 0 through 65535.
public ReadUnsignedShort ( ) : int
return int

SkipBytes() public method

Makes an attempt to skip over n bytes of data from the input stream, discarding the skipped bytes.
public SkipBytes ( int n ) : int
n int
return int