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...")
 
(Updating KSP.IO docs)
Line 5: Line 5:
 
}}
 
}}
 
{{MethodsStart}}
 
{{MethodsStart}}
 
{{Method
 
|returntype=void
 
|returndesc=
 
|name=Close
 
|args=
 
}}
 
 
{{StaticMethod
 
{{StaticMethod
 
|returntype=BinaryWriter
 
|returntype=BinaryWriter
Line 22: Line 15:
 
|returntype=void
 
|returntype=void
 
|returndesc=
 
|returndesc=
|name=Dispose
+
|name=Write
|args=
+
|args=string value
|desc=Identical to Close()
+
|desc=
 
}}
 
}}
 
{{Method
 
{{Method
 
|returntype=void
 
|returntype=void
 
|returndesc=
 
|returndesc=
|name=Flush
+
|name=Write
|args=
+
|args=ulong value
 +
|desc=
 
}}
 
}}
 
{{Method
 
{{Method
|returntype=long
+
|returntype=void
 
|returndesc=
 
|returndesc=
|name=Seek
+
|name=Write
|args=int offset, SeekOrigin origin
+
|args=char ch
 +
|desc=
 
}}
 
}}
 
{{Method
 
{{Method
 
|returntype=void
 
|returntype=void
 
|returndesc=
 
|returndesc=
|name=Write
+
|name=Close
|args=bool value
+
|args=
 +
|desc=
 
}}
 
}}
 
{{Method
 
{{Method
Line 49: Line 45:
 
|name=Write
 
|name=Write
 
|args=byte[] buffer
 
|args=byte[] buffer
 +
|desc=
 
}}
 
}}
 
{{Method
 
{{Method
Line 54: Line 51:
 
|returndesc=
 
|returndesc=
 
|name=Write
 
|name=Write
|args=byte value
+
|args=char[] chars
 +
|desc=
 
}}
 
}}
 
{{Method
 
{{Method
Line 60: Line 58:
 
|returndesc=
 
|returndesc=
 
|name=Write
 
|name=Write
|args=char[] chars
+
|args=ushort value
 +
|desc=
 
}}
 
}}
 
{{Method
 
{{Method
Line 66: Line 65:
 
|returndesc=
 
|returndesc=
 
|name=Write
 
|name=Write
|args=char ch
+
|args=sbyte value
 +
|desc=
 
}}
 
}}
 
{{Method
 
{{Method
Line 72: Line 72:
 
|returndesc=
 
|returndesc=
 
|name=Write
 
|name=Write
|args=decimal value
+
|args=byte value
 +
|desc=
 
}}
 
}}
 
{{Method
 
{{Method
Line 78: Line 79:
 
|returndesc=
 
|returndesc=
 
|name=Write
 
|name=Write
|args=double value
+
|args=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 93:
 
|returndesc=
 
|returndesc=
 
|name=Write
 
|name=Write
|args=int value
+
|args=short value
 +
|desc=
 
}}
 
}}
 
{{Method
 
{{Method
Line 96: Line 100:
 
|returndesc=
 
|returndesc=
 
|name=Write
 
|name=Write
|args=long value
+
|args=double value
 +
|desc=
 
}}
 
}}
 
{{Method
 
{{Method
Line 102: Line 107:
 
|returndesc=
 
|returndesc=
 
|name=Write
 
|name=Write
|args=sbyte value
+
|args=decimal value
 +
|desc=
 
}}
 
}}
 
{{Method
 
{{Method
Line 109: Line 115:
 
|name=Write
 
|name=Write
 
|args=float value
 
|args=float value
 +
|desc=
 
}}
 
}}
 
{{Method
 
{{Method
Line 114: Line 121:
 
|returndesc=
 
|returndesc=
 
|name=Write
 
|name=Write
|args=string value
+
|args=uint value
 +
|desc=
 
}}
 
}}
 
{{Method
 
{{Method
Line 120: Line 128:
 
|returndesc=
 
|returndesc=
 
|name=Write
 
|name=Write
|args=ushort value
+
|args=int value
 +
|desc=
 
}}
 
}}
 
{{Method
 
{{Method
Line 126: Line 135:
 
|returndesc=
 
|returndesc=
 
|name=Write
 
|name=Write
|args=uint value
+
|args=char[] chars, int index, int count
 +
|desc=
 
}}
 
}}
 
{{Method
 
{{Method
Line 132: Line 142:
 
|returndesc=
 
|returndesc=
 
|name=Write
 
|name=Write
|args=ulong value
+
|args=byte[] buffer, int index, int count
 +
|desc=
 +
}}
 +
{{Method
 +
|returntype=long
 +
|returndesc=
 +
|name=Seek
 +
|args=int offset, 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 163:
 
|returndesc=
 
|returndesc=
 
|name=Write
 
|name=Write
|args=char[] chars, int index, int count
+
|args=long value
 +
|desc=
 
}}
 
}}
 
{{MethodsEnd}}
 
{{MethodsEnd}}

Revision as of 05:35, 23 August 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.

Methods

The following are methods included in BinaryWriter.

Signature Description
static BinaryWriter CreateForType<T>(string filename, Vessel flight = null) Factory method for creating a BinaryWriter for the desired filename.
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)