Difference between revisions of "API:BinaryReader"
From Kerbal Space Program Wiki
(Updating KSP.IO docs) |
|||
Line 13: | Line 13: | ||
}} | }} | ||
{{Method | {{Method | ||
− | |returntype= | + | |returntype=short |
+ | |returndesc= | ||
+ | |name=ReadInt16 | ||
+ | |args= | ||
+ | |desc= | ||
+ | }} | ||
+ | {{Method | ||
+ | |returntype=int | ||
|returndesc= | |returndesc= | ||
− | |name= | + | |name=Read |
|args= | |args= | ||
+ | |desc= | ||
}} | }} | ||
{{Method | {{Method | ||
− | |returntype= | + | |returntype=float |
|returndesc= | |returndesc= | ||
− | |name= | + | |name=ReadSingle |
|args= | |args= | ||
+ | |desc= | ||
}} | }} | ||
{{Method | {{Method | ||
− | |returntype= | + | |returntype=void |
|returndesc= | |returndesc= | ||
− | |name= | + | |name=Close |
|args= | |args= | ||
+ | |desc= | ||
}} | }} | ||
{{Method | {{Method | ||
− | |returntype= | + | |returntype=uint |
|returndesc= | |returndesc= | ||
− | |name= | + | |name=ReadUInt32 |
|args= | |args= | ||
+ | |desc= | ||
}} | }} | ||
{{Method | {{Method | ||
− | |returntype= | + | |returntype=double |
|returndesc= | |returndesc= | ||
− | |name= | + | |name=ReadDouble |
− | |args= | + | |args= |
+ | |desc= | ||
}} | }} | ||
{{Method | {{Method | ||
− | |returntype= | + | |returntype=long |
|returndesc= | |returndesc= | ||
− | |name= | + | |name=ReadInt64 |
− | |args= | + | |args= |
+ | |desc= | ||
}} | }} | ||
{{Method | {{Method | ||
− | |returntype= | + | |returntype=string |
|returndesc= | |returndesc= | ||
− | |name= | + | |name=ReadString |
|args= | |args= | ||
+ | |desc= | ||
}} | }} | ||
{{Method | {{Method | ||
− | |returntype= | + | |returntype=int |
|returndesc= | |returndesc= | ||
− | |name= | + | |name=PeekChar |
|args= | |args= | ||
+ | |desc= | ||
}} | }} | ||
{{Method | {{Method | ||
− | |returntype= | + | |returntype=int |
|returndesc= | |returndesc= | ||
− | |name= | + | |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= | + | |returntype=bool |
|returndesc= | |returndesc= | ||
− | |name= | + | |name=ReadBoolean |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
|args= | |args= | ||
+ | |desc= | ||
}} | }} | ||
{{Method | {{Method | ||
− | |returntype= | + | |returntype=int |
|returndesc= | |returndesc= | ||
− | |name= | + | |name=Read |
− | |args= | + | |args=byte[] buffer, int index, int count |
+ | |desc= | ||
}} | }} | ||
{{Method | {{Method | ||
− | |returntype= | + | |returntype=byte |
|returndesc= | |returndesc= | ||
− | |name= | + | |name=ReadByte |
|args= | |args= | ||
+ | |desc= | ||
}} | }} | ||
{{Method | {{Method | ||
− | |returntype= | + | |returntype=ushort |
|returndesc= | |returndesc= | ||
− | |name= | + | |name=ReadUInt16 |
|args= | |args= | ||
+ | |desc= | ||
}} | }} | ||
{{Method | {{Method | ||
− | |returntype= | + | |returntype=char[] |
|returndesc= | |returndesc= | ||
− | |name= | + | |name=ReadChars |
− | |args= | + | |args=int count |
+ | |desc= | ||
}} | }} | ||
{{Method | {{Method | ||
Line 113: | Line 129: | ||
|name=ReadSByte | |name=ReadSByte | ||
|args= | |args= | ||
+ | |desc= | ||
}} | }} | ||
{{Method | {{Method | ||
− | |returntype= | + | |returntype=ulong |
|returndesc= | |returndesc= | ||
− | |name= | + | |name=ReadUInt64 |
|args= | |args= | ||
+ | |desc= | ||
}} | }} | ||
{{Method | {{Method | ||
− | |returntype= | + | |returntype=int |
|returndesc= | |returndesc= | ||
− | |name= | + | |name=ReadInt32 |
|args= | |args= | ||
+ | |desc= | ||
}} | }} | ||
{{Method | {{Method | ||
− | |returntype= | + | |returntype=decimal |
|returndesc= | |returndesc= | ||
− | |name= | + | |name=ReadDecimal |
|args= | |args= | ||
+ | |desc= | ||
}} | }} | ||
{{Method | {{Method | ||
− | |returntype= | + | |returntype=byte[] |
|returndesc= | |returndesc= | ||
− | |name= | + | |name=ReadBytes |
− | |args= | + | |args=int count |
+ | |desc= | ||
}} | }} | ||
{{Method | {{Method | ||
− | |returntype= | + | |returntype=void |
|returndesc= | |returndesc= | ||
− | |name= | + | |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() |