# BinaryRider

### Import List

        Channel
        Msg
        Object
        Object

Class List
ErrorContext | This record is exported, so that extensions of Channel can access the error descriptions by extending ErrorContextDesc.
Reader |
Writer |

Class Summary: ErrorContext [Detail]

      +---Msg.Context
           |
           +---Channel.ErrorContext
                |
                +--BinaryRider.ErrorContext

This record is exported, so that extensions of Channel can access the error descriptions by extending ErrorContextDesc.

Inherited Fields
From Msg.Context: id
Inherited Methods
From Channel.ErrorContext: GetTemplate

Class Summary: Reader [Detail]

      +--BinaryRider.Reader

Field Summary
base-: Channel The channel on which this reader is operating.
byteOrder-: SHORTINT Endian settings for the reader.
byteReader-: Reader Binary reader underneath this text reader.
res: Msg
Constructor Summary
ConnectReader(Channel): Reader
InitReader(Reader, Channel, SHORTINT)
Method Summary
Available(): LONGINT
ClearError()
Pos(): LONGINT
ReadBool(VAR BOOLEAN)
ReadBytes(VAR ARRAY OF BYTE, LONGINT, LONGINT) Read the bytes according to the native machine byte order.
[ReadBytesOrdered](VAR ARRAY OF BYTE)
ReadChar(VAR CHAR)
ReadInt(VAR INTEGER)
ReadLChar(VAR LONGCHAR)
ReadLInt(VAR LONGINT)
ReadLReal(VAR LONGREAL)
ReadLString(VAR ARRAY OF LONGCHAR) The string s is filled until ``0X`' is encountered, there are no more characters in the channel, or the string is filled.
ReadNum(VAR LONGINT)
ReadReal(VAR REAL)
ReadSInt(VAR SHORTINT)
ReadSet(VAR SET)
ReadStr(VAR String)
ReadString(VAR ARRAY OF CHAR) The string s is filled until ``0X`' is encountered, there are no more characters in the channel, or the string is filled.
SetByteOrder(SHORTINT)
SetPos(LONGINT)

Class Summary: Writer [Detail]

      +--BinaryRider.Writer

Field Summary
base-: Channel The channel on which this writer is operating.
byteOrder-: SHORTINT Endian settings for the writer.
byteWriter-: Writer Binary writer underneath this text writer.
res: Msg
Constructor Summary
ConnectWriter(Channel): Writer
InitWriter(Writer, Channel, SHORTINT)
Method Summary
ClearError()
Pos(): LONGINT
SetByteOrder(SHORTINT)
SetPos(LONGINT)
WriteBool(BOOLEAN)
WriteBytes(ARRAY OF BYTE, LONGINT, LONGINT)
[WriteBytesOrdered](VAR ARRAY OF BYTE)
WriteChar(CHAR)
WriteInt(INTEGER)
WriteLChar(LONGCHAR)
WriteLInt(LONGINT)
WriteLReal(LONGREAL)
WriteLString(ARRAY OF LONGCHAR) The terminating ``0X`' is also written.
WriteNum(LONGINT) Write integers in a compressed and portable format.
WriteReal(REAL)
WriteSInt(SHORTINT)
WriteSet(SET)
WriteStr(String)
WriteString(ARRAY OF CHAR) Note: The terminating ``0X`' is also written.

Constant Summary
bigEndian Read/write most significant byte first.
done
invalidFormat
littleEndian Read/write least significant byte first.
nativeEndian Do whatever the host machine uses.
readAfterEnd

Class Detail: ErrorContext

Class Detail: Reader

Field Detail

### base

    FIELD base-: Channel

> The channel on which this reader is operating.

### byteOrder

    FIELD byteOrder-: SHORTINT

> Endian settings for the reader.

### byteReader

    FIELD byteReader-: Reader

> Binary reader underneath this text reader. This field should only be used by extensions of this type.

### res

    FIELD res: Msg

Constructor Detail

### ConnectReader

    PROCEDURE ConnectReader(ch: Channel): Reader

### InitReader

    PROCEDURE InitReader(r: Reader;
                         ch: Channel;
                         byteOrder: SHORTINT)

Method Detail

### Available

    PROCEDURE (r: Reader) Available(): LONGINT

### ClearError

    PROCEDURE (r: Reader) ClearError()

### Pos

    PROCEDURE (r: Reader) Pos(): LONGINT

### ReadBool

    PROCEDURE (r: Reader) ReadBool(VAR bool: BOOLEAN)

### ReadBytes

    PROCEDURE (r: Reader) ReadBytes(VAR x: ARRAY OF BYTE;
                        start: LONGINT;
                        n: LONGINT)

> Read the bytes according to the native machine byte order.

### ReadBytesOrdered

    PROCEDURE (r: Reader) [ReadBytesOrdered](VAR x: ARRAY OF BYTE)

### ReadChar

    PROCEDURE (r: Reader) ReadChar(VAR ch: CHAR)

### ReadInt

    PROCEDURE (r: Reader) ReadInt(VAR int: INTEGER)

### ReadLChar

    PROCEDURE (r: Reader) ReadLChar(VAR ch: LONGCHAR)

### ReadLInt

    PROCEDURE (r: Reader) ReadLInt(VAR lint: LONGINT)

### ReadLReal

    PROCEDURE (r: Reader) ReadLReal(VAR lreal: LONGREAL)

### ReadLString

    PROCEDURE (r: Reader) ReadLString(VAR s: ARRAY OF LONGCHAR)

> The string s is filled until ``0X`' is encountered, there are no more characters in the channel, or the string is filled. s is always terminated with ``0X`'.

### ReadNum

    PROCEDURE (r: Reader) ReadNum(VAR num: LONGINT)

### ReadReal

    PROCEDURE (r: Reader) ReadReal(VAR real: REAL)

### ReadSInt

    PROCEDURE (r: Reader) ReadSInt(VAR sint: SHORTINT)

### ReadSet

    PROCEDURE (r: Reader) ReadSet(VAR s: SET)

### ReadStr

    PROCEDURE (r: Reader) ReadStr(VAR s: String)

### ReadString

    PROCEDURE (r: Reader) ReadString(VAR s: ARRAY OF CHAR)

> The string s is filled until ``0X`' is encountered, there are no more characters in the channel, or the string is filled. s is always terminated with ``0X`'.

### SetByteOrder

    PROCEDURE (r: Reader) SetByteOrder(order: SHORTINT)

### SetPos

    PROCEDURE (r: Reader) SetPos(newPos: LONGINT)

Class Detail: Writer

Field Detail

### base

    FIELD base-: Channel

> The channel on which this writer is operating.

### byteOrder

    FIELD byteOrder-: SHORTINT

> Endian settings for the writer.

### byteWriter

    FIELD byteWriter-: Writer

> Binary writer underneath this text writer. This field should only be used by extensions of this type.

### res

    FIELD res: Msg

Constructor Detail

### ConnectWriter

    PROCEDURE ConnectWriter(ch: Channel): Writer

### InitWriter

    PROCEDURE InitWriter(w: Writer;
                         ch: Channel;
                         byteOrder: SHORTINT)

Method Detail

### ClearError

    PROCEDURE (w: Writer) ClearError()

### Pos

    PROCEDURE (w: Writer) Pos(): LONGINT

### SetByteOrder

    PROCEDURE (w: Writer) SetByteOrder(order: SHORTINT)

### SetPos

    PROCEDURE (w: Writer) SetPos(newPos: LONGINT)

### WriteBool

    PROCEDURE (w: Writer) WriteBool(bool: BOOLEAN)

### WriteBytes

    PROCEDURE (w: Writer) WriteBytes(x: ARRAY OF BYTE;
                         start: LONGINT;
                         n: LONGINT)

### WriteBytesOrdered

    PROCEDURE (w: Writer) [WriteBytesOrdered](VAR x: ARRAY OF BYTE)

### WriteChar

    PROCEDURE (w: Writer) WriteChar(ch: CHAR)

### WriteInt

    PROCEDURE (w: Writer) WriteInt(int: INTEGER)

### WriteLChar

    PROCEDURE (w: Writer) WriteLChar(ch: LONGCHAR)

### WriteLInt

    PROCEDURE (w: Writer) WriteLInt(lint: LONGINT)

### WriteLReal

    PROCEDURE (w: Writer) WriteLReal(lreal: LONGREAL)

### WriteLString

    PROCEDURE (w: Writer) WriteLString(s: ARRAY OF LONGCHAR)

> The terminating ``0X`' is also written.

### WriteNum

    PROCEDURE (w: Writer) WriteNum(lint: LONGINT)

> Write integers in a compressed and portable format.

### WriteReal

    PROCEDURE (w: Writer) WriteReal(real: REAL)

### WriteSInt

    PROCEDURE (w: Writer) WriteSInt(sint: SHORTINT)

### WriteSet

    PROCEDURE (w: Writer) WriteSet(s: SET)

### WriteStr

    PROCEDURE (w: Writer) WriteStr(s: String)

### WriteString

    PROCEDURE (w: Writer) WriteString(s: ARRAY OF CHAR)

> Note: The terminating ``0X`' is also written.

Constant Detail

### bigEndian

    CONST bigEndian

> Read/write most significant byte first.

### done

    CONST done

### invalidFormat

    CONST invalidFormat

### littleEndian

    CONST littleEndian

> Read/write least significant byte first.

### nativeEndian

    CONST nativeEndian

> Do whatever the host machine uses.

### readAfterEnd

    CONST readAfterEnd