BinaryStream

Overview

Wrapper around stream to read/write binary data in little endian order.

Location

  • Reference:
    • Elements.dll  .NET, .NET Standard 2.0
    • elements.jar  Cooper
    • Elements.fx  Island, ToffeeV2
    • libElements.fx  Toffee
  • Namespace: RemObjects.Elements.RTL

 

constructor (Stream): InstanceType .NET, .NET Standard 2.0, Cooper, Island, Toffee

Creates a new binary reader; this defaults to utf8 encoding.

 

constructor(aStream: Stream)

 

BinaryStream(Stream aStream)

 

init(_ aStream: Stream)

 

BinaryStream(Stream aStream)

Parameters:

  • aStream:

constructor (Stream, Encoding): InstanceType .NET, .NET Standard 2.0, Cooper, Island, Toffee

Creates a new binary reader; the encoding can be used to define which encoding chars/strings are written in.

 

constructor(aStream: Stream; aEncoding: Encoding)

 

BinaryStream(Stream aStream, Encoding aEncoding)

 

init(_ aStream: Stream, _ aEncoding: Encoding)

 

BinaryStream(Stream aStream, Encoding aEncoding)

Parameters:

  • aStream:
  • aEncoding:

constructor init (Stream) ToffeeV2

Creates a new binary reader; this defaults to utf8 encoding.

 

func constructor init(_ aStream: Stream)

Parameters:

  • aStream:

constructor init (Stream, Encoding) ToffeeV2

Creates a new binary reader; the encoding can be used to define which encoding chars/strings are written in.

 

func constructor init(_ aStream: Stream, _ aEncoding: Encoding)

Parameters:

  • aStream:
  • aEncoding:

BaseStream

Returns the stream this wrapper is writing to/reading from.

 

property BaseStream: Stream read;

 

Stream BaseStream { get; }

 

var BaseStream: Stream { get{} }

 

Stream BaseStream { __get; }

PeekChar

Look ahead 1 character and returns it (or -1 if it's the end of teh stream)

 

method PeekChar: Int32

 

Int32 PeekChar()

 

func PeekChar() -> Int32

 

Integer PeekChar()

Read

Reads a single character from this stream, returns -1 if the end of the stream has been reached

 

method Read: Int32

 

Int32 Read()

 

func Read() -> Int32

 

Integer Read()

Read (Int32): array of Byte

Read an array of bytes from the stream.

 

method Read(Count: Int32): array of Byte

 

Byte[] Read(Int32 Count)

 

func Read(_ Count: Int32) -> Byte...

 

Byte[] Read(Integer Count)

Parameters:

  • Count:

ReadByte

Read a byte from this stream.

 

method ReadByte: Byte

 

Byte ReadByte()

 

func ReadByte() -> Byte

 

Byte ReadByte()

ReadDouble

Read a double from this stream.

 

method ReadDouble: Double

 

Double ReadDouble()

 

func ReadDouble() -> Double

 

Double ReadDouble()

ReadInt16

Read a 2 byte integer from this stream.

 

method ReadInt16: Int16

 

Int16 ReadInt16()

 

func ReadInt16() -> Int16

 

SmallInt ReadInt16()

ReadInt32

Read a 4 byte integer from this stream.

 

method ReadInt32: Int32

 

Int32 ReadInt32()

 

func ReadInt32() -> Int32

 

Integer ReadInt32()

ReadInt64

Read an 8 byte integer from this stream.

 

method ReadInt64: Int64

 

Int64 ReadInt64()

 

func ReadInt64() -> Int64

 

Int64 ReadInt64()

ReadSByte

Read a (signed) byte from this stream

 

method ReadSByte: SByte

 

SByte ReadSByte()

 

func ReadSByte() -> SByte

 

SByte ReadSByte()

ReadSingle

Read a single precision float from this stream.

 

method ReadSingle: Single

 

Single ReadSingle()

 

func ReadSingle() -> Single

 

Single ReadSingle()

ReadString

Read a string from this stream, count is the number of bytes to read.

 

method ReadString(Count: Int32): String

 

String ReadString(Int32 Count)

 

func ReadString(_ Count: Int32) -> String

 

String ReadString(Integer Count)

Parameters:

  • Count:

Write (array of Byte, Int32, Int32)

Write binary data to the stream.

 

method Write(aValue: array of Byte; Offset: Int32; Count: Int32)

 

void Write(Byte[] aValue, Int32 Offset, Int32 Count)

 

func Write(_ aValue: Byte..., _ Offset: Int32, _ Count: Int32)

 

void Write(Byte[] aValue, Integer Offset, Integer Count)

Parameters:

  • aValue:
  • Offset:
  • Count:

Write (Byte)

Write a byte to this stream.

 

method Write(aValue: Byte)

 

void Write(Byte aValue)

 

func Write(_ aValue: Byte)

 

void Write(Byte aValue)

Parameters:

  • aValue:

WriteByte

Write a byte to this stream.

 

method WriteByte(Value: Byte)

 

void WriteByte(Byte Value)

 

func WriteByte(_ Value: Byte)

 

void WriteByte(Byte Value)

Parameters:

  • Value:

WriteDouble

Write a double to this stream.

 

method WriteDouble(Value: Double)

 

void WriteDouble(Double Value)

 

func WriteDouble(_ Value: Double)

 

void WriteDouble(Double Value)

Parameters:

  • Value:

WriteInt16

Write an int16 to this stream.

 

method WriteInt16(Value: Int16)

 

void WriteInt16(Int16 Value)

 

func WriteInt16(_ Value: Int16)

 

void WriteInt16(SmallInt Value)

Parameters:

  • Value:

WriteInt32

Write an int32 to this stream.

 

method WriteInt32(Value: Int32)

 

void WriteInt32(Int32 Value)

 

func WriteInt32(_ Value: Int32)

 

void WriteInt32(Integer Value)

Parameters:

  • Value:

WriteInt64

Write an int64 to this stream.

 

method WriteInt64(Value: Int64)

 

void WriteInt64(Int64 Value)

 

func WriteInt64(_ Value: Int64)

 

void WriteInt64(Int64 Value)

Parameters:

  • Value:

WriteSByte

Write a signed byte to this stream.

 

method WriteSByte(Value: SByte)

 

void WriteSByte(SByte Value)

 

func WriteSByte(_ Value: SByte)

 

void WriteSByte(SByte Value)

Parameters:

  • Value:

WriteSingle

Write a string to this stream.

 

method WriteSingle(Value: Single)

 

void WriteSingle(Single Value)

 

func WriteSingle(_ Value: Single)

 

void WriteSingle(Single Value)

Parameters:

  • Value:

WriteString

Write a string to this stream.

 

method WriteString(aString: String)

 

void WriteString(String aString)

 

func WriteString(_ aString: String)

 

void WriteString(String aString)

Parameters:

  • aString:

 

BaseStream

Returns the stream this wrapper is writing to/reading from.

 

property BaseStream: Stream read;

 

Stream BaseStream { get; }

 

var BaseStream: Stream { get{} }

 

Stream BaseStream { __get; }

 

constructor init (Stream) ToffeeV2

Creates a new binary reader; this defaults to utf8 encoding.

 

func constructor init(_ aStream: Stream)

Parameters:

  • aStream:

constructor init (Stream, Encoding) ToffeeV2

Creates a new binary reader; the encoding can be used to define which encoding chars/strings are written in.

 

func constructor init(_ aStream: Stream, _ aEncoding: Encoding)

Parameters:

  • aStream:
  • aEncoding:

constructor (Stream): InstanceType .NET, .NET Standard 2.0, Cooper, Island, Toffee

Creates a new binary reader; this defaults to utf8 encoding.

 

constructor(aStream: Stream)

 

BinaryStream(Stream aStream)

 

init(_ aStream: Stream)

 

BinaryStream(Stream aStream)

Parameters:

  • aStream:

constructor (Stream, Encoding): InstanceType .NET, .NET Standard 2.0, Cooper, Island, Toffee

Creates a new binary reader; the encoding can be used to define which encoding chars/strings are written in.

 

constructor(aStream: Stream; aEncoding: Encoding)

 

BinaryStream(Stream aStream, Encoding aEncoding)

 

init(_ aStream: Stream, _ aEncoding: Encoding)

 

BinaryStream(Stream aStream, Encoding aEncoding)

Parameters:

  • aStream:
  • aEncoding:

PeekChar

Look ahead 1 character and returns it (or -1 if it's the end of teh stream)

 

method PeekChar: Int32

 

Int32 PeekChar()

 

func PeekChar() -> Int32

 

Integer PeekChar()

Read

Reads a single character from this stream, returns -1 if the end of the stream has been reached

 

method Read: Int32

 

Int32 Read()

 

func Read() -> Int32

 

Integer Read()

Read (Int32): array of Byte

Read an array of bytes from the stream.

 

method Read(Count: Int32): array of Byte

 

Byte[] Read(Int32 Count)

 

func Read(_ Count: Int32) -> Byte...

 

Byte[] Read(Integer Count)

Parameters:

  • Count:

ReadByte

Read a byte from this stream.

 

method ReadByte: Byte

 

Byte ReadByte()

 

func ReadByte() -> Byte

 

Byte ReadByte()

ReadDouble

Read a double from this stream.

 

method ReadDouble: Double

 

Double ReadDouble()

 

func ReadDouble() -> Double

 

Double ReadDouble()

ReadInt16

Read a 2 byte integer from this stream.

 

method ReadInt16: Int16

 

Int16 ReadInt16()

 

func ReadInt16() -> Int16

 

SmallInt ReadInt16()

ReadInt32

Read a 4 byte integer from this stream.

 

method ReadInt32: Int32

 

Int32 ReadInt32()

 

func ReadInt32() -> Int32

 

Integer ReadInt32()

ReadInt64

Read an 8 byte integer from this stream.

 

method ReadInt64: Int64

 

Int64 ReadInt64()

 

func ReadInt64() -> Int64

 

Int64 ReadInt64()

ReadSByte

Read a (signed) byte from this stream

 

method ReadSByte: SByte

 

SByte ReadSByte()

 

func ReadSByte() -> SByte

 

SByte ReadSByte()

ReadSingle

Read a single precision float from this stream.

 

method ReadSingle: Single

 

Single ReadSingle()

 

func ReadSingle() -> Single

 

Single ReadSingle()

ReadString

Read a string from this stream, count is the number of bytes to read.

 

method ReadString(Count: Int32): String

 

String ReadString(Int32 Count)

 

func ReadString(_ Count: Int32) -> String

 

String ReadString(Integer Count)

Parameters:

  • Count:

Write (array of Byte, Int32, Int32)

Write binary data to the stream.

 

method Write(aValue: array of Byte; Offset: Int32; Count: Int32)

 

void Write(Byte[] aValue, Int32 Offset, Int32 Count)

 

func Write(_ aValue: Byte..., _ Offset: Int32, _ Count: Int32)

 

void Write(Byte[] aValue, Integer Offset, Integer Count)

Parameters:

  • aValue:
  • Offset:
  • Count:

Write (Byte)

Write a byte to this stream.

 

method Write(aValue: Byte)

 

void Write(Byte aValue)

 

func Write(_ aValue: Byte)

 

void Write(Byte aValue)

Parameters:

  • aValue:

WriteByte

Write a byte to this stream.

 

method WriteByte(Value: Byte)

 

void WriteByte(Byte Value)

 

func WriteByte(_ Value: Byte)

 

void WriteByte(Byte Value)

Parameters:

  • Value:

WriteDouble

Write a double to this stream.

 

method WriteDouble(Value: Double)

 

void WriteDouble(Double Value)

 

func WriteDouble(_ Value: Double)

 

void WriteDouble(Double Value)

Parameters:

  • Value:

WriteInt16

Write an int16 to this stream.

 

method WriteInt16(Value: Int16)

 

void WriteInt16(Int16 Value)

 

func WriteInt16(_ Value: Int16)

 

void WriteInt16(SmallInt Value)

Parameters:

  • Value:

WriteInt32

Write an int32 to this stream.

 

method WriteInt32(Value: Int32)

 

void WriteInt32(Int32 Value)

 

func WriteInt32(_ Value: Int32)

 

void WriteInt32(Integer Value)

Parameters:

  • Value:

WriteInt64

Write an int64 to this stream.

 

method WriteInt64(Value: Int64)

 

void WriteInt64(Int64 Value)

 

func WriteInt64(_ Value: Int64)

 

void WriteInt64(Int64 Value)

Parameters:

  • Value:

WriteSByte

Write a signed byte to this stream.

 

method WriteSByte(Value: SByte)

 

void WriteSByte(SByte Value)

 

func WriteSByte(_ Value: SByte)

 

void WriteSByte(SByte Value)

Parameters:

  • Value:

WriteSingle

Write a string to this stream.

 

method WriteSingle(Value: Single)

 

void WriteSingle(Single Value)

 

func WriteSingle(_ Value: Single)

 

void WriteSingle(Single Value)

Parameters:

  • Value:

WriteString

Write a string to this stream.

 

method WriteString(aString: String)

 

void WriteString(String aString)

 

func WriteString(_ aString: String)

 

void WriteString(String aString)

Parameters:

  • aString: