Difference between revisions of "API:BinaryReader"

From Kerbal Space Program Wiki
Jump to: navigation, search
Line 1: Line 1:
 +
<!-- Autogenerated by DOCTOOL.  Yell at N3X15 if it breaks. -->
 
{{Namespace:KSP.IO}}
 
{{Namespace:KSP.IO}}
 
{{Class
 
{{Class
Line 7: Line 8:
 
{{StaticMethod
 
{{StaticMethod
 
|returntype=BinaryReader
 
|returntype=BinaryReader
|returndesc=The binary reader requested
+
|returndesc=
 
|name=CreateForType<T>
 
|name=CreateForType<T>
|args={{arg|string|filename}}, {{arg|Vessel|flight|default = null}}
+
|args={{arg|string|filename}}, {{arg|Vessel|flight|default=null}}
 
|desc=Create a binary reader with the desired filename.
 
|desc=Create a binary reader with the desired filename.
 
}}
 
}}

Revision as of 21:31, 12 October 2012

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.

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)
char ReadChar()
bool ReadBoolean()
int Read(byte[] buffer, int index, int count)
byte ReadByte()
ushort ReadUInt16()
char[] ReadChars(int count)
sbyte ReadSByte()
ulong ReadUInt64()
int ReadInt32()
decimal ReadDecimal()
byte[] ReadBytes(int count)
void Dispose()