API:BinaryReader

From Kerbal Space Program Wiki
Revision as of 09:47, 14 October 2012 by N3X15 (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

KSP.IO Namespace
BinaryReader · BinaryWriter · File · FileInfo · FileStream · IOException · IOTools · IOUtils · MemoryStream · PluginConfigNode · PluginConfiguration · TextReader · TextWriter

BinaryReader Class

Identical to System.IO.BinaryReader, but with added IDisposable methods (for use in using structures), and a factory method instead of constructors.

Properties

The following are public properties available in BinaryReader.

Signature Description
Stream BaseStream { get; } Grab the underlying Stream.

Methods

The following are methods included in BinaryReader.

Signature Description
static BinaryReader CreateForType<T>(string filename, Vessel flight = null) Create a binary reader with the desired filename.
short ReadInt16()
int Read()
float ReadSingle()
void Close()
uint ReadUInt32()
double ReadDouble()
long ReadInt64()
string ReadString()
int PeekChar()
int Read(char[] buffer, int index, int count) Read a block of chars from the stream.
char ReadChar()
bool ReadBoolean()
int Read(byte[] buffer, int index, int count) Read a block of bytes from the stream.
byte ReadByte()
ushort ReadUInt16()
char[] ReadChars(int count)
sbyte ReadSByte()
ulong ReadUInt64()
int ReadInt32()
decimal ReadDecimal()
byte[] ReadBytes(int count)
void Dispose() Close the stream and any resources (e.g. files) it has open.