Difference between revisions of "API:BinaryReader"

From Kerbal Space Program Wiki
Jump to: navigation, search
(Updating KSP.IO docs)
Line 13: Line 13:
 
}}
 
}}
 
{{Method
 
{{Method
|returntype=void
+
|returntype=short
 +
|returndesc=
 +
|name=ReadInt16
 +
|args=
 +
|desc=
 +
}}
 +
{{Method
 +
|returntype=int
 
|returndesc=
 
|returndesc=
|name=Close
+
|name=Read
 
|args=
 
|args=
 +
|desc=
 
}}
 
}}
 
{{Method
 
{{Method
|returntype=void
+
|returntype=float
 
|returndesc=
 
|returndesc=
|name=Dispose
+
|name=ReadSingle
 
|args=
 
|args=
 +
|desc=
 
}}
 
}}
 
{{Method
 
{{Method
|returntype=int
+
|returntype=void
 
|returndesc=
 
|returndesc=
|name=PeekChar
+
|name=Close
 
|args=
 
|args=
 +
|desc=
 
}}
 
}}
 
{{Method
 
{{Method
|returntype=int
+
|returntype=uint
 
|returndesc=
 
|returndesc=
|name=Read
+
|name=ReadUInt32
 
|args=
 
|args=
 +
|desc=
 
}}
 
}}
 
{{Method
 
{{Method
|returntype=int
+
|returntype=double
 
|returndesc=
 
|returndesc=
|name=Read
+
|name=ReadDouble
|args=byte[] buffer, int index, int count
+
|args=
 +
|desc=
 
}}
 
}}
 
{{Method
 
{{Method
|returntype=int
+
|returntype=long
 
|returndesc=
 
|returndesc=
|name=Read
+
|name=ReadInt64
|args=char[] buffer, int index, int count
+
|args=
 +
|desc=
 
}}
 
}}
 
{{Method
 
{{Method
|returntype=bool
+
|returntype=string
 
|returndesc=
 
|returndesc=
|name=ReadBoolean
+
|name=ReadString
 
|args=
 
|args=
 +
|desc=
 
}}
 
}}
 
{{Method
 
{{Method
|returntype=byte
+
|returntype=int
 
|returndesc=
 
|returndesc=
|name=ReadByte
+
|name=PeekChar
 
|args=
 
|args=
 +
|desc=
 
}}
 
}}
 
{{Method
 
{{Method
|returntype=byte[]
+
|returntype=int
 
|returndesc=
 
|returndesc=
|name=ReadBytes
+
|name=Read
|args=int count
+
|args=char[] buffer, int index, int count
 +
|desc=
 
}}
 
}}
 
{{Method
 
{{Method
Line 71: Line 87:
 
|name=ReadChar
 
|name=ReadChar
 
|args=
 
|args=
 +
|desc=
 
}}
 
}}
 
{{Method
 
{{Method
|returntype=char[]
+
|returntype=bool
 
|returndesc=
 
|returndesc=
|name=ReadChars
+
|name=ReadBoolean
|args=int count
 
}}
 
{{Method
 
|returntype=decimal
 
|returndesc=
 
|name=ReadDecimal
 
 
|args=
 
|args=
 +
|desc=
 
}}
 
}}
 
{{Method
 
{{Method
|returntype=double
+
|returntype=int
 
|returndesc=
 
|returndesc=
|name=ReadDouble
+
|name=Read
|args=
+
|args=byte[] buffer, int index, int count
 +
|desc=
 
}}
 
}}
 
{{Method
 
{{Method
|returntype=short
+
|returntype=byte
 
|returndesc=
 
|returndesc=
|name=ReadInt16
+
|name=ReadByte
 
|args=
 
|args=
 +
|desc=
 
}}
 
}}
 
{{Method
 
{{Method
|returntype=int
+
|returntype=ushort
 
|returndesc=
 
|returndesc=
|name=ReadInt32
+
|name=ReadUInt16
 
|args=
 
|args=
 +
|desc=
 
}}
 
}}
 
{{Method
 
{{Method
|returntype=long
+
|returntype=char[]
 
|returndesc=
 
|returndesc=
|name=ReadInt64
+
|name=ReadChars
|args=
+
|args=int count
 +
|desc=
 
}}
 
}}
 
{{Method
 
{{Method
Line 113: Line 129:
 
|name=ReadSByte
 
|name=ReadSByte
 
|args=
 
|args=
 +
|desc=
 
}}
 
}}
 
{{Method
 
{{Method
|returntype=float
+
|returntype=ulong
 
|returndesc=
 
|returndesc=
|name=ReadSingle
+
|name=ReadUInt64
 
|args=
 
|args=
 +
|desc=
 
}}
 
}}
 
{{Method
 
{{Method
|returntype=string
+
|returntype=int
 
|returndesc=
 
|returndesc=
|name=ReadString
+
|name=ReadInt32
 
|args=
 
|args=
 +
|desc=
 
}}
 
}}
 
{{Method
 
{{Method
|returntype=ushort
+
|returntype=decimal
 
|returndesc=
 
|returndesc=
|name=ReadUInt16
+
|name=ReadDecimal
 
|args=
 
|args=
 +
|desc=
 
}}
 
}}
 
{{Method
 
{{Method
|returntype=uint
+
|returntype=byte[]
 
|returndesc=
 
|returndesc=
|name=ReadUInt32
+
|name=ReadBytes
|args=
+
|args=int count
 +
|desc=
 
}}
 
}}
 
{{Method
 
{{Method
|returntype=ulong
+
|returntype=void
 
|returndesc=
 
|returndesc=
|name=ReadUInt64
+
|name=Dispose
 
|args=
 
|args=
 +
|desc=
 
}}
 
}}
 
{{MethodsEnd}}
 
{{MethodsEnd}}

Revision as of 05:28, 23 August 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()