Difference between revisions of "API:BinaryWriter"

From Kerbal Space Program Wiki
Jump to: navigation, search
 
Line 5: Line 5:
 
|summary=Identical to System.IO.BinaryWriter, but with added IDisposable methods (for use in using structures), and a factory method instead of constructors.
 
|summary=Identical to System.IO.BinaryWriter, but with added IDisposable methods (for use in using structures), and a factory method instead of constructors.
 
}}
 
}}
 +
{{PropertiesStart}}
 +
{{Property
 +
|type=Stream
 +
|name=BaseStream
 +
|desc=
 +
|hasget=1
 +
|hasset=
 +
}}
 +
{{PropertiesEnd}}
 
{{MethodsStart}}
 
{{MethodsStart}}
 
{{StaticMethod
 
{{StaticMethod
Line 11: Line 20:
 
|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=Factory method for creating a BinaryWriter for the desired filename.
+
|desc=Create a binary file writer.
 
}}
 
}}
 
{{Method
 
{{Method

Latest revision as of 23:42, 12 October 2012

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

BinaryWriter Class

Identical to System.IO.BinaryWriter, 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 BinaryWriter.

Signature Description
Stream BaseStream { get; }

Methods

The following are methods included in BinaryWriter.

Signature Description
static BinaryWriter CreateForType<T>(string filename, Vessel flight = null) Create a binary file writer.
void Write(string value)
void Write(ulong value)
void Write(char ch)
void Close()
void Write(byte[] buffer)
void Write(char[] chars)
void Write(ushort value)
void Write(sbyte value)
void Write(byte value)
void Write(bool value)
void Flush()
void Write(short value)
void Write(double value)
void Write(decimal value)
void Write(float value)
void Write(uint value)
void Write(int value)
void Write(char[] chars, int index, int count)
void Write(byte[] buffer, int index, int count)
long Seek(int offset, KSP.IO.SeekOrigin origin)
void Dispose()
void Write(long value)