Show / Hide Table of Contents

    Class EndianBinaryWriter

    A BinaryWriter that switches the endian orientation of the write operations so that they are compatible across platforms.

    Inheritance
    System.Object
    System.IO.BinaryWriter
    EndianBinaryWriter
    Implements
    System.IDisposable
    Inherited Members
    System.IO.BinaryWriter.Null
    System.IO.BinaryWriter.OutStream
    System.IO.BinaryWriter.Close()
    System.IO.BinaryWriter.Dispose()
    System.IO.BinaryWriter.Dispose(System.Boolean)
    System.IO.BinaryWriter.Flush()
    System.IO.BinaryWriter.Seek(System.Int32, System.IO.SeekOrigin)
    System.IO.BinaryWriter.Write(System.Boolean)
    System.IO.BinaryWriter.Write(System.Byte)
    System.IO.BinaryWriter.Write(System.Byte[])
    System.IO.BinaryWriter.Write(System.Byte[], System.Int32, System.Int32)
    System.IO.BinaryWriter.Write(System.Decimal)
    System.IO.BinaryWriter.Write(System.SByte)
    System.IO.BinaryWriter.Write7BitEncodedInt(System.Int32)
    System.IO.BinaryWriter.BaseStream
    System.Object.Equals(System.Object)
    System.Object.Equals(System.Object, System.Object)
    System.Object.GetHashCode()
    System.Object.GetType()
    System.Object.MemberwiseClone()
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.ToString()
    Namespace: Apache.NMS.Util
    Assembly: Apache.NMS.dll
    Syntax
    [CLSCompliant(false)]
    public class EndianBinaryWriter : BinaryWriter, IDisposable

    Constructors

    | Improve this Doc View Source

    EndianBinaryWriter(Stream)

    Declaration
    public EndianBinaryWriter(Stream output)
    Parameters
    Type Name Description
    System.IO.Stream output

    Fields

    | Improve this Doc View Source

    MAXSTRINGLEN

    Declaration
    public const int MAXSTRINGLEN = 32767
    Field Value
    Type Description
    System.Int32

    Methods

    | Improve this Doc View Source

    Write(Char)

    Method Write

    Declaration
    public override void Write(char ch)
    Parameters
    Type Name Description
    System.Char ch

    A char

    Overrides
    System.IO.BinaryWriter.Write(System.Char)
    | Improve this Doc View Source

    Write(Char[])

    Method Write

    Declaration
    public override void Write(char[] chars)
    Parameters
    Type Name Description
    System.Char[] chars

    A char[]

    Overrides
    System.IO.BinaryWriter.Write(System.Char[])
    | Improve this Doc View Source

    Write(Char[], Int32, Int32)

    Method Write

    Declaration
    public override void Write(char[] chars, int index, int count)
    Parameters
    Type Name Description
    System.Char[] chars

    A char[]

    System.Int32 index

    An int

    System.Int32 count

    An int

    Overrides
    System.IO.BinaryWriter.Write(System.Char[], System.Int32, System.Int32)
    | Improve this Doc View Source

    Write(Double)

    Method Write

    Declaration
    public override void Write(double value)
    Parameters
    Type Name Description
    System.Double value

    A double

    Overrides
    System.IO.BinaryWriter.Write(System.Double)
    | Improve this Doc View Source

    Write(Int16)

    Method Write

    Declaration
    public override void Write(short value)
    Parameters
    Type Name Description
    System.Int16 value

    A short

    Overrides
    System.IO.BinaryWriter.Write(System.Int16)
    | Improve this Doc View Source

    Write(Int32)

    Method Write

    Declaration
    public override void Write(int value)
    Parameters
    Type Name Description
    System.Int32 value

    An int

    Overrides
    System.IO.BinaryWriter.Write(System.Int32)
    | Improve this Doc View Source

    Write(Int64)

    Method Write

    Declaration
    public override void Write(long value)
    Parameters
    Type Name Description
    System.Int64 value

    A long

    Overrides
    System.IO.BinaryWriter.Write(System.Int64)
    | Improve this Doc View Source

    Write(Single)

    Method Write

    Declaration
    public override void Write(float value)
    Parameters
    Type Name Description
    System.Single value

    A double

    Overrides
    System.IO.BinaryWriter.Write(System.Single)
    | Improve this Doc View Source

    Write(String)

    Method Write, writes a string to the output using the WriteString16 method.

    Declaration
    public override void Write(string text)
    Parameters
    Type Name Description
    System.String text

    A string

    Overrides
    System.IO.BinaryWriter.Write(System.String)
    | Improve this Doc View Source

    Write(UInt16)

    Method Write

    Declaration
    public override void Write(ushort value)
    Parameters
    Type Name Description
    System.UInt16 value

    An ushort

    Overrides
    System.IO.BinaryWriter.Write(System.UInt16)
    | Improve this Doc View Source

    Write(UInt32)

    Method Write

    Declaration
    public override void Write(uint value)
    Parameters
    Type Name Description
    System.UInt32 value

    An uint

    Overrides
    System.IO.BinaryWriter.Write(System.UInt32)
    | Improve this Doc View Source

    Write(UInt64)

    Method Write

    Declaration
    public override void Write(ulong value)
    Parameters
    Type Name Description
    System.UInt64 value

    An ulong

    Overrides
    System.IO.BinaryWriter.Write(System.UInt64)
    | Improve this Doc View Source

    WriteString16(String)

    Method WriteString16, writes a string to the output using the Java standard modified UTF-8 encoding with an unsigned short value written first to indicate the length of the encoded data, the short is read as an unsigned value so the max amount of data this method can write is 65535 encoded bytes.

    Unlike the WriteString32 method this method does not encode the length value to -1 if the string is null, this is to match the behaviour of the Java DataOuputStream class's writeUTF method.

    Because modified UTF-8 encding can result in a number of bytes greater that the size of the String this method must first check that the encoding proces will not result in a value that cannot be written becuase it is greater than the max value of an unsigned short.

    Declaration
    public void WriteString16(string text)
    Parameters
    Type Name Description
    System.String text

    A string

    | Improve this Doc View Source

    WriteString32(String)

    Method WriteString32, writes a string to the output using the Openwire standard modified UTF-8 encoding which an int value written first to indicate the length of the encoded data, the int is read as an signed value so the max amount of data this method can write is 2^31 encoded bytes.

    In the case of a null value being passed this method writes a -1 to the stream to indicate that the string is null.

    Because modified UTF-8 encding can result in a number of bytes greater that the size of the String this method must first check that the encoding proces will not result in a value that cannot be written becuase it is greater than the max value of an int.

    Declaration
    public void WriteString32(string text)
    Parameters
    Type Name Description
    System.String text

    A string

    Implements

    System.IDisposable
    • Improve this Doc
    • View Source
    Back to top Copyright © 2005-2022 Apache Software Foundation project
    Generated by DocFX