BinReaderWriter Class

From RemObjects Wiki
Jump to: navigation, search

This is a Library topic for RemObjects SDK for Java
This page is generated from external data, please do not update

NamespacesInterfacesClassesEnumsImplements

Contents

Overview

This class is used to serialize and deserialize any kind of data into the bytes buffer. It provides a lot of symmetrical read/write methods for each datatype, so you can easily write and read any objects to and from ByteStream. This class is used by the BinMessage to read/write data into the binary message. In most cases you do not need to deal with this class directly.


Location

  • Archive: com.remobjects.sdk.jar
  • Namespace: com.remobjects.sdk
  • Ancestry: java.lang.Object | BinReaderWriter


Instance Methods

constructor

Creates BinReaderWriter.


Oxygene:   constructor ()

Java:   BinReaderWriter()


clear

Clears internal streams.


Oxygene:   method clear()

Java:   void clear()


clone

Creates copy of the BinReaderWriter.


Oxygene:   method clone(): Object

Java:   Object clone()


getInputStream

Returns input stream.


Oxygene:   method getInputStream(): ByteArrayInputStream

Java:   ByteArrayInputStream getInputStream()


getOutputStream

Returns output stream.


Oxygene:   method getOutputStream(): ByteArrayOutputStream

Java:   ByteArrayOutputStream getOutputStream()


readAnsiString

Reads the next value as AnsiString from the stream.


Oxygene:   method readAnsiString(): String

Java:   String readAnsiString()


readBoolean

Reads the next Int32 value from the stream as Boolean.


Oxygene:   method readBoolean(): boolean

Java:   boolean readBoolean()


readByte

Reads the next Byte value from the stream.


Oxygene:   method readByte(): byte

Java:   byte readByte()


readBytes (int): array of byte

Reads the bytes buffer with the specified size.


Oxygene:   method readBytes(aLength: int): array of byte

Java:   array of byte readBytes(int aLength)


Parameters:

  • aLength: Given size.


readBytes (int, int): array of byte

Reads the bytes buffer with the given size and offset.


Oxygene:   method readBytes(aLength: int; aOffset: int): array of byte

Java:   array of byte readBytes(int aLength, int aOffset)


Parameters:

  • aLength: Given size.
  • aOffset: Given offset.


readCurrencyBigEndian

Reads the next currency value from the BE stream.


Oxygene:   method readCurrencyBigEndian(): BigDecimal

Java:   BigDecimal readCurrencyBigEndian()


readCurrencyLittleEndian

Reads the next currency value from the LE stream.


Oxygene:   method readCurrencyLittleEndian(): BigDecimal

Java:   BigDecimal readCurrencyLittleEndian()


readDateTime

Reads the next date value from the stream.


Oxygene:   method readDateTime(): Date

Java:   Date readDateTime()


readDecimalLittleEndian

Reads the next decimal value from the LE stream.


Oxygene:   method readDecimalLittleEndian(): BigDecimal

Java:   BigDecimal readDecimalLittleEndian()


readDoubleBigEndian

Reads the next double value from the BE stream.


Oxygene:   method readDoubleBigEndian(): double

Java:   double readDoubleBigEndian()


readDoubleLittleEndian

Reads the next double value from the LE stream.


Oxygene:   method readDoubleLittleEndian(): double

Java:   double readDoubleLittleEndian()


readEnum

Reads the next enum value from the stream.


Oxygene:   method readEnum(): int

Java:   int readEnum()


readGuid

Reads the next UUID value from the stream.


Oxygene:   method readGuid(): UUID

Java:   UUID readGuid()


readInt16BigEndian

Reads the next short value from the BE stream.


Oxygene:   method readInt16BigEndian(): short

Java:   short readInt16BigEndian()


readInt16LittleEndian

Reads the next short value from the LE stream.


Oxygene:   method readInt16LittleEndian(): short

Java:   short readInt16LittleEndian()


readInt32BigEndian

Reads the next int value from the BE stream.


Oxygene:   method readInt32BigEndian(): int

Java:   int readInt32BigEndian()


readInt32LittleEndian

Reads the next int value from the LE stream.


Oxygene:   method readInt32LittleEndian(): int

Java:   int readInt32LittleEndian()


readInt64BigEndian

Reads the next long value from the BE stream.


Oxygene:   method readInt64BigEndian(): long

Java:   long readInt64BigEndian()


readInt64LittleEndian

Reads the next long value from the LE stream.


Oxygene:   method readInt64LittleEndian(): long

Java:   long readInt64LittleEndian()


readSingleBigEndian

Reads the next float value from the BE stream.


Oxygene:   method readSingleBigEndian(): float

Java:   float readSingleBigEndian()


readSingleLittleEndian

Reads the next float value from the LE stream.


Oxygene:   method readSingleLittleEndian(): float

Java:   float readSingleLittleEndian()


readUtf8String

Reads the next value as UTF8String from the stream.


Oxygene:   method readUtf8String(): String

Java:   String readUtf8String()


readVariant

Reads the next VariantType value from the stream.


Oxygene:   method readVariant(aValue: VariantType; aTypeCode: VariantTypeCode)

Java:   void readVariant(VariantType aValue, VariantTypeCode aTypeCode)


Parameters:


readWideString

Reads the next value as WideString from the stream.


Oxygene:   method readWideString(): String

Java:   String readWideString()


setInputStream

Sets given input stream.


Oxygene:   method setInputStream(aStream: ByteArrayInputStream)

Java:   void setInputStream(ByteArrayInputStream aStream)


Parameters:

  • aStream: Given stream.


setOutputStream

Set given output strream.


Oxygene:   method setOutputStream(aStream: ByteArrayOutputStream)

Java:   void setOutputStream(ByteArrayOutputStream aStream)


Parameters:

  • aStream: Given stream.


tryReadUtf8String

Reads a Utf8 string value from the stream. In contrast to the readUtf8String: method, this method does not throw an unexpectedStringLength exception when attempting to read nonexistent data at the end of the stream.


Oxygene:   method tryReadUtf8String(): String

Java:   String tryReadUtf8String()


writeAnsiString

Writes a String value into the stream as WideString.


Oxygene:   method writeAnsiString(aValue: String)

Java:   void writeAnsiString(String aValue)


Parameters:

  • aValue: Given value.


writeBoolean

Writes the given boolean value into the stream as Int32 value, where 0 is false and any other value is true.


Oxygene:   method writeBoolean(aValue: boolean)

Java:   void writeBoolean(boolean aValue)


Parameters:

  • aValue: Given value.


writeByte

Writes the given Byte value into the stream.


Oxygene:   method writeByte(aValue: byte)

Java:   void writeByte(byte aValue)


Parameters:

  • aValue: Given value.


writeBytes (array of byte, int)

Writes the bytes buffer with the given length into the stream.


Oxygene:   method writeBytes(aBuffer: array of byte; aLength: int)

Java:   void writeBytes(array of byte aBuffer, int aLength)


Parameters:

  • aBuffer: Given stream.
  • aLength: Given count of bytes to be written.


writeBytes (array of byte, int, int)

Writes the bytes buffer with the given length and offset into the stream.


Oxygene:   method writeBytes(aBuffer: array of byte; aLength: int; aOffset: int)

Java:   void writeBytes(array of byte aBuffer, int aLength, int aOffset)


Parameters:

  • aBuffer: Given stream.
  • aLength: Given count of bytes to be written.
  • aOffset: Given offset for incoming buffer.


writeCurrencyBigEndian

Writes a Currency value into the BE stream.


Oxygene:   method writeCurrencyBigEndian(aValue: BigDecimal)

Java:   void writeCurrencyBigEndian(BigDecimal aValue)


Parameters:

  • aValue: Given value.


writeCurrencyLittleEndian

Currency value to be put into the LE stream


Oxygene:   method writeCurrencyLittleEndian(aValue: BigDecimal)

Java:   void writeCurrencyLittleEndian(BigDecimal aValue)


Parameters:

  • aValue: Given value.


writeDateTime

Writes a date value into the stream.


Oxygene:   method writeDateTime(aValue: Date)

Java:   void writeDateTime(Date aValue)


Parameters:

  • aValue: Given value.


writeDecimalLittleEndian

Writes a Decimal value into the LE stream.


Oxygene:   method writeDecimalLittleEndian(aValue: BigDecimal)

Java:   void writeDecimalLittleEndian(BigDecimal aValue)


Parameters:

  • aValue: Given value.


writeDoubleBigEndian

Writes a Double value into the BE stream.


Oxygene:   method writeDoubleBigEndian(aValue: double)

Java:   void writeDoubleBigEndian(double aValue)


Parameters:

  • aValue: Given value.


writeDoubleLittleEndian

Writes a Double value into the LE stream.


Oxygene:   method writeDoubleLittleEndian(aValue: double)

Java:   void writeDoubleLittleEndian(double aValue)


Parameters:

  • aValue: Given value.


writeEnum

Writes an enumeration item value into the stream.


Oxygene:   method writeEnum(aValue: int)

Java:   void writeEnum(int aValue)


Parameters:

  • aValue: Given value.


writeGuid

Writes a UUID value into the stream.


Oxygene:   method writeGuid(aValue: UUID)

Java:   void writeGuid(UUID aValue)


Parameters:

  • aValue: Given value.


writeInt16BigEndian

Writes an short value into the BE stream.


Oxygene:   method writeInt16BigEndian(aValue: short)

Java:   void writeInt16BigEndian(short aValue)


Parameters:

  • aValue: Given value.


writeInt16LittleEndian

Writes an short value into the LE stream.


Oxygene:   method writeInt16LittleEndian(aValue: short)

Java:   void writeInt16LittleEndian(short aValue)


Parameters:

  • aValue: Given value.


writeInt32BigEndian

Writes an int value into the BE stream.


Oxygene:   method writeInt32BigEndian(aValue: int)

Java:   void writeInt32BigEndian(int aValue)


Parameters:

  • aValue: Given value.


writeInt32LittleEndian

Writes an int value into the LE stream.


Oxygene:   method writeInt32LittleEndian(aValue: int)

Java:   void writeInt32LittleEndian(int aValue)


Parameters:

  • aValue: Given value.


writeInt64BigEndian

Writes an long value into the BE stream.


Oxygene:   method writeInt64BigEndian(aValue: long)

Java:   void writeInt64BigEndian(long aValue)


Parameters:

  • aValue: Given value.


writeInt64LittleEndian

Writes an long value into the LE stream.


Oxygene:   method writeInt64LittleEndian(aValue: long)

Java:   void writeInt64LittleEndian(long aValue)


Parameters:

  • aValue: Given value.


writeSingleBigEndian

Writes an float value into the BE stream.


Oxygene:   method writeSingleBigEndian(aValue: float)

Java:   void writeSingleBigEndian(float aValue)


Parameters:

  • aValue: Given value.


writeSingleLittleEndian

Writes an float value into the LE stream.


Oxygene:   method writeSingleLittleEndian(aValue: float)

Java:   void writeSingleLittleEndian(float aValue)


Parameters:

  • aValue: Given value.


writeUtf8String

Writes a string value into the stream as UTF8 String.


Oxygene:   method writeUtf8String(aValue: String)

Java:   void writeUtf8String(String aValue)


Parameters:

  • aValue: Given value.


writeWideString

Writes a String value into the stream as WideString.


Oxygene:   method writeWideString(aValue: String)

Java:   void writeWideString(String aValue)


Parameters:

  • aValue: Given value.


See Also


Product: RemObjects SDK
Available Editions: RemObjects SDK for .NET, Xcode, Delphi, Java and JavaScript

GlossaryArticlesLibrarySamples

Personal tools
Namespaces

Variants
Actions
Navigation
products
platforms
special
Toolbox