Difference between revisions of "API:BinaryWriter"

From Kerbal Space Program Wiki
Jump to: navigation, search
(Created page with "{{Namespace:KSP.IO}} {{Class |name=BinaryWriter |summary=Identical to System.IO.BinaryWriter, but with added IDisposable methods (for use in using structures), and a factory m...")
 
 
(4 intermediate revisions by the same user not shown)
Line 1: Line 1:
 +
<!-- Autogenerated by DOCTOOL.  Yell at N3X15 if it breaks. -->
 
{{Namespace:KSP.IO}}
 
{{Namespace:KSP.IO}}
 
{{Class
 
{{Class
Line 4: 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}}
 
{{Method
 
|returntype=void
 
|returndesc=
 
|name=Close
 
|args=
 
}}
 
 
{{StaticMethod
 
{{StaticMethod
 
|returntype=BinaryWriter
 
|returntype=BinaryWriter
 
|returndesc=
 
|returndesc=
 
|name=CreateForType<T>
 
|name=CreateForType<T>
|args=string filename, Vessel flight = 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
 
|returntype=void
 
|returntype=void
 
|returndesc=
 
|returndesc=
|name=Dispose
+
|name=Write
|args=
+
|args={{arg|string|value}}
|desc=Identical to Close()
+
|desc=
 
}}
 
}}
 
{{Method
 
{{Method
 
|returntype=void
 
|returntype=void
 
|returndesc=
 
|returndesc=
|name=Flush
+
|name=Write
|args=
+
|args={{arg|ulong|value}}
 +
|desc=
 
}}
 
}}
 
{{Method
 
{{Method
|returntype=long
+
|returntype=void
 
|returndesc=
 
|returndesc=
|name=Seek
+
|name=Write
|args=int offset, SeekOrigin origin
+
|args={{arg|char|ch}}
 +
|desc=
 
}}
 
}}
 
{{Method
 
{{Method
 
|returntype=void
 
|returntype=void
 
|returndesc=
 
|returndesc=
|name=Write
+
|name=Close
|args=bool value
+
|args=
 +
|desc=
 
}}
 
}}
 
{{Method
 
{{Method
Line 48: Line 54:
 
|returndesc=
 
|returndesc=
 
|name=Write
 
|name=Write
|args=byte[] buffer
+
|args={{arg|byte|buffer|array=[]}}
 +
|desc=
 
}}
 
}}
 
{{Method
 
{{Method
Line 54: Line 61:
 
|returndesc=
 
|returndesc=
 
|name=Write
 
|name=Write
|args=byte value
+
|args={{arg|char|chars|array=[]}}
 +
|desc=
 
}}
 
}}
 
{{Method
 
{{Method
Line 60: Line 68:
 
|returndesc=
 
|returndesc=
 
|name=Write
 
|name=Write
|args=char[] chars
+
|args={{arg|ushort|value}}
 +
|desc=
 
}}
 
}}
 
{{Method
 
{{Method
Line 66: Line 75:
 
|returndesc=
 
|returndesc=
 
|name=Write
 
|name=Write
|args=char ch
+
|args={{arg|sbyte|value}}
 +
|desc=
 
}}
 
}}
 
{{Method
 
{{Method
Line 72: Line 82:
 
|returndesc=
 
|returndesc=
 
|name=Write
 
|name=Write
|args=decimal value
+
|args={{arg|byte|value}}
 +
|desc=
 
}}
 
}}
 
{{Method
 
{{Method
Line 78: Line 89:
 
|returndesc=
 
|returndesc=
 
|name=Write
 
|name=Write
|args=double value
+
|args={{arg|bool|value}}
 +
|desc=
 
}}
 
}}
 
{{Method
 
{{Method
 
|returntype=void
 
|returntype=void
 
|returndesc=
 
|returndesc=
|name=Write
+
|name=Flush
|args=short value
+
|args=
 +
|desc=
 
}}
 
}}
 
{{Method
 
{{Method
Line 90: Line 103:
 
|returndesc=
 
|returndesc=
 
|name=Write
 
|name=Write
|args=int value
+
|args={{arg|short|value}}
 +
|desc=
 
}}
 
}}
 
{{Method
 
{{Method
Line 96: Line 110:
 
|returndesc=
 
|returndesc=
 
|name=Write
 
|name=Write
|args=long value
+
|args={{arg|double|value}}
 +
|desc=
 
}}
 
}}
 
{{Method
 
{{Method
Line 102: Line 117:
 
|returndesc=
 
|returndesc=
 
|name=Write
 
|name=Write
|args=sbyte value
+
|args={{arg|decimal|value}}
 +
|desc=
 
}}
 
}}
 
{{Method
 
{{Method
Line 108: Line 124:
 
|returndesc=
 
|returndesc=
 
|name=Write
 
|name=Write
|args=float value
+
|args={{arg|float|value}}
 +
|desc=
 
}}
 
}}
 
{{Method
 
{{Method
Line 114: Line 131:
 
|returndesc=
 
|returndesc=
 
|name=Write
 
|name=Write
|args=string value
+
|args={{arg|uint|value}}
 +
|desc=
 
}}
 
}}
 
{{Method
 
{{Method
Line 120: Line 138:
 
|returndesc=
 
|returndesc=
 
|name=Write
 
|name=Write
|args=ushort value
+
|args={{arg|int|value}}
 +
|desc=
 
}}
 
}}
 
{{Method
 
{{Method
Line 126: Line 145:
 
|returndesc=
 
|returndesc=
 
|name=Write
 
|name=Write
|args=uint value
+
|args={{arg|char|chars|array=[]}}, {{arg|int|index}}, {{arg|int|count}}
 +
|desc=
 
}}
 
}}
 
{{Method
 
{{Method
Line 132: Line 152:
 
|returndesc=
 
|returndesc=
 
|name=Write
 
|name=Write
|args=ulong value
+
|args={{arg|byte|buffer|array=[]}}, {{arg|int|index}}, {{arg|int|count}}
 +
|desc=
 +
}}
 +
{{Method
 +
|returntype=long
 +
|returndesc=
 +
|name=Seek
 +
|args={{arg|int|offset}}, {{arg|KSP.IO.SeekOrigin|origin}}
 +
|desc=
 
}}
 
}}
 
{{Method
 
{{Method
 
|returntype=void
 
|returntype=void
 
|returndesc=
 
|returndesc=
|name=Write
+
|name=Dispose
|args=byte[] buffer, int index, int count
+
|args=
 +
|desc=
 
}}
 
}}
 
{{Method
 
{{Method
Line 144: Line 173:
 
|returndesc=
 
|returndesc=
 
|name=Write
 
|name=Write
|args=char[] chars, int index, int count
+
|args={{arg|long|value}}
 +
|desc=
 
}}
 
}}
 
{{MethodsEnd}}
 
{{MethodsEnd}}

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)