Click or drag to resize
BinaryOutput Class

Binary standard output. This class provides methods for converting primtive type variables (boolean, byte, char, int, long, float, and double) to sequences of bits and writing them to standard output. Uses .NET representations, in little-endian (least-significant byte first).

The client must Flush() the output stream when finished writing bits and should not intermixing calls to output with calls to Console or Console.Out; otherwise unexpected behavior will result.

Inheritance Hierarchy
SystemObject
  Algs4NetBinaryOutput

Namespace: Algs4Net
Assembly: Algs4Net (in Algs4Net.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
public sealed class BinaryOutput

The BinaryOutput type exposes the following members.

Constructors
  NameDescription
Public methodBinaryOutput
Represents an output stream from a source, which may not be the standard output
Top
Methods
  NameDescription
Public methodClose
Flush and close standard output. Once standard output is closed, you can no longer write bits to it.
Public methodFlush
Flush standard output, padding 0s if number of bits written so far is not a multiple of 8.
Public methodStatic memberMainTest
Test client.
Public methodWrite(Boolean)
Write the specified bit to standard output.
Public methodWrite(Byte)
Write the 8-bit byte to standard output.
Public methodWrite(Char)
Write the 8-bit char to standard output.
Public methodWrite(Double)
Write the 64-bit double to standard output.
Public methodWrite(Int16)
Write the 16-bit int to standard output.
Public methodWrite(Int32)
Write the 32-bit int to standard output.
Public methodWrite(Int64)
Write the 64-bit long to standard output.
Public methodWrite(Single)
Write the 32-bit float to standard output.
Public methodWrite(String)
Write the string of 8-bit characters to standard output.
Public methodWrite(Char, Int32)
Write the r-bit char to standard output.
Public methodWrite(Int32, Int32)
Write the r-bit int to standard output.
Public methodWrite(String, Int32)
Write the string of r-bit characters to standard output.
Top
Remarks
This class is a C# port from the original Java class output implementation by Robert Sedgewick and Kevin Wayne.
See Also