C# 클래스 MiscUtil.IO.EndianBinaryWriter

Equivalent of System.IO.BinaryWriter, but with either endianness, depending on the EndianBitConverter it is constructed with.
상속: IDisposable
파일 보기 프로젝트 열기: jadref/buffer_bci 1 사용 예제들

공개 메소드들

메소드 설명
Close ( ) : void

Closes the writer, including the underlying stream.

Dispose ( ) : void

Disposes of the underlying stream.

EndianBinaryWriter ( EndianBitConverter bitConverter, Stream stream ) : System

Constructs a new binary writer with the given bit converter, writing to the given stream, using UTF-8 encoding.

EndianBinaryWriter ( EndianBitConverter bitConverter, Stream stream, Encoding encoding ) : System

Constructs a new binary writer with the given bit converter, writing to the given stream, using the given encoding.

Flush ( ) : void

Flushes the underlying stream.

Seek ( int offset, SeekOrigin origin ) : void

Seeks within the stream.

Write ( bool value ) : void

Writes a boolean value to the stream. 1 byte is written.

Write ( byte value ) : void

Writes a signed byte to the stream.

Write ( byte value, int offset, int count ) : void

Writes a portion of an array of bytes to the stream.

Write ( char value ) : void

Writes a single character to the stream, using the encoding for this writer.

Write ( decimal value ) : void

Writes a decimal value to the stream, using the bit converter for this writer. 16 bytes are written.

Write ( double value ) : void

Writes a double-precision floating-point value to the stream, using the bit converter for this writer. 8 bytes are written.

Write ( float value ) : void

Writes a single-precision floating-point value to the stream, using the bit converter for this writer. 4 bytes are written.

Write ( int value ) : void

Writes a 32-bit signed integer to the stream, using the bit converter for this writer. 4 bytes are written.

Write ( long value ) : void

Writes a 64-bit signed integer to the stream, using the bit converter for this writer. 8 bytes are written.

Write ( sbyte value ) : void

Writes an unsigned byte to the stream.

Write ( short value ) : void

Writes a 16-bit signed integer to the stream, using the bit converter for this writer. 2 bytes are written.

Write ( string value ) : void

Writes a string to the stream, using the encoding for this writer.

Write ( uint value ) : void

Writes a 32-bit unsigned integer to the stream, using the bit converter for this writer. 4 bytes are written.

Write ( ulong value ) : void

Writes a 64-bit unsigned integer to the stream, using the bit converter for this writer. 8 bytes are written.

Write ( ushort value ) : void

Writes a 16-bit unsigned integer to the stream, using the bit converter for this writer. 2 bytes are written.

Write7BitEncodedInt ( int value ) : void

Writes a 7-bit encoded integer from the stream. This is stored with the least significant information first, with 7 bits of information per byte of value, and the top bit as a continuation flag.

비공개 메소드들

메소드 설명
CheckDisposed ( ) : void

Checks whether or not the writer has been disposed, throwing an exception if so.

WriteInternal ( byte bytes, int length ) : void

Writes the specified number of bytes from the start of the given byte array, after checking whether or not the writer has been disposed.

메소드 상세

Close() 공개 메소드

Closes the writer, including the underlying stream.
public Close ( ) : void
리턴 void

Dispose() 공개 메소드

Disposes of the underlying stream.
public Dispose ( ) : void
리턴 void

EndianBinaryWriter() 공개 메소드

Constructs a new binary writer with the given bit converter, writing to the given stream, using UTF-8 encoding.
public EndianBinaryWriter ( EndianBitConverter bitConverter, Stream stream ) : System
bitConverter MiscUtil.Conversion.EndianBitConverter Converter to use when writing data
stream Stream Stream to write data to
리턴 System

EndianBinaryWriter() 공개 메소드

Constructs a new binary writer with the given bit converter, writing to the given stream, using the given encoding.
public EndianBinaryWriter ( EndianBitConverter bitConverter, Stream stream, Encoding encoding ) : System
bitConverter MiscUtil.Conversion.EndianBitConverter Converter to use when writing data
stream Stream Stream to write data to
encoding System.Text.Encoding Encoding to use when writing character data
리턴 System

Flush() 공개 메소드

Flushes the underlying stream.
public Flush ( ) : void
리턴 void

Seek() 공개 메소드

Seeks within the stream.
public Seek ( int offset, SeekOrigin origin ) : void
offset int Offset to seek to.
origin SeekOrigin Origin of seek operation.
리턴 void

Write() 공개 메소드

Writes a boolean value to the stream. 1 byte is written.
public Write ( bool value ) : void
value bool The value to write
리턴 void

Write() 공개 메소드

Writes a signed byte to the stream.
public Write ( byte value ) : void
value byte The value to write
리턴 void

Write() 공개 메소드

Writes a portion of an array of bytes to the stream.
public Write ( byte value, int offset, int count ) : void
value byte An array containing the bytes to write
offset int The index of the first byte to write within the array
count int The number of bytes to write
리턴 void

Write() 공개 메소드

Writes a single character to the stream, using the encoding for this writer.
public Write ( char value ) : void
value char The value to write
리턴 void

Write() 공개 메소드

Writes a decimal value to the stream, using the bit converter for this writer. 16 bytes are written.
public Write ( decimal value ) : void
value decimal The value to write
리턴 void

Write() 공개 메소드

Writes a double-precision floating-point value to the stream, using the bit converter for this writer. 8 bytes are written.
public Write ( double value ) : void
value double The value to write
리턴 void

Write() 공개 메소드

Writes a single-precision floating-point value to the stream, using the bit converter for this writer. 4 bytes are written.
public Write ( float value ) : void
value float The value to write
리턴 void

Write() 공개 메소드

Writes a 32-bit signed integer to the stream, using the bit converter for this writer. 4 bytes are written.
public Write ( int value ) : void
value int The value to write
리턴 void

Write() 공개 메소드

Writes a 64-bit signed integer to the stream, using the bit converter for this writer. 8 bytes are written.
public Write ( long value ) : void
value long The value to write
리턴 void

Write() 공개 메소드

Writes an unsigned byte to the stream.
public Write ( sbyte value ) : void
value sbyte The value to write
리턴 void

Write() 공개 메소드

Writes a 16-bit signed integer to the stream, using the bit converter for this writer. 2 bytes are written.
public Write ( short value ) : void
value short The value to write
리턴 void

Write() 공개 메소드

Writes a string to the stream, using the encoding for this writer.
value is null
public Write ( string value ) : void
value string The value to write. Must not be null.
리턴 void

Write() 공개 메소드

Writes a 32-bit unsigned integer to the stream, using the bit converter for this writer. 4 bytes are written.
public Write ( uint value ) : void
value uint The value to write
리턴 void

Write() 공개 메소드

Writes a 64-bit unsigned integer to the stream, using the bit converter for this writer. 8 bytes are written.
public Write ( ulong value ) : void
value ulong The value to write
리턴 void

Write() 공개 메소드

Writes a 16-bit unsigned integer to the stream, using the bit converter for this writer. 2 bytes are written.
public Write ( ushort value ) : void
value ushort The value to write
리턴 void

Write7BitEncodedInt() 공개 메소드

Writes a 7-bit encoded integer from the stream. This is stored with the least significant information first, with 7 bits of information per byte of value, and the top bit as a continuation flag.
public Write7BitEncodedInt ( int value ) : void
value int The 7-bit encoded integer to write to the stream
리턴 void