Cross-Platform C++

ot::io
class DataOutput  (abstract)

#include "ot/io/DataOutput.h"

ot::ManagedObject ot::io::DataOutputStream ot::io::RandomAccessFile An abstract base class that provides methods for writing fixed-length data blocks in a platform-independent manner.

See also:
DataInput
Since:
OpenTop 1.4



Method Summary
 virtual void write(const Byte* pBuffer, size_t bufLen)=0
        
 virtual void writeBoolean(bool bValue)
         Converts a boolean value to a single Byte with value 1 for true or 0 for false and writes it to the stream.
 virtual void writeByte(Byte value)
         Writes a single Byte to the stream.
 virtual void writeInt64(Int64Type value)
         Converts the given 64-bit integer value into a 2s complement, big-endian representation which is 8 bytes long and writes those bytes to this stream.
 virtual void writeLong(long value)
         Converts the given long integer value into a 2s complement, big-endian representation which is 4 bytes long and writes those bytes to this stream.
 virtual void writeShort(short value)
         Converts the given short integer value into a 2s complement, big-endian representation which is 2 bytes long and writes those bytes to this stream.
 virtual void writeUnsignedInt64(UInt64Type value)
         Converts the given 64-bit unsigned integer value into a 2s complement, big-endian representation which is 8 bytes long and writes those bytes to this stream.
 virtual void writeUnsignedLong(unsigned long value)
         Converts the given unsigned long integer value into a 2s complement, big-endian representation which is 4 bytes long and writes those bytes to this stream.
 virtual void writeUnsignedShort(unsigned short value)
         Converts the given unsigned short integer value into a 2s complement, big-endian representation which is 2 bytes long and writes those bytes to this stream.
 virtual void writeUTF(const String& strValue)
         Writes a Unicode String value in a length-prefixed UTF format.

Methods inherited from class ot::ManagedObject
addRef(), getRefCount(), onFinalRelease(), operator=(const ManagedObject&), release()

Method Detail

write

virtual void write(const Byte* pBuffer,
                   size_t bufLen)=0


writeBoolean

virtual void writeBoolean(bool bValue)
Converts a boolean value to a single Byte with value 1 for true or 0 for false and writes it to the stream.

Parameters:
value - the boolean value to write.
Exceptions:
IOException - if an I/O error occurs.
See also:
DataInput::readBoolean()

writeByte

virtual void writeByte(Byte value)
Writes a single Byte to the stream.

Parameters:
value - the Byte value to write.
Exceptions:
IOException - if an I/O error occurs.
See also:
DataInput::readByte()

writeInt64

virtual void writeInt64(Int64Type value)
Converts the given 64-bit integer value into a 2s complement, big-endian representation which is 8 bytes long and writes those bytes to this stream.

Parameters:
value - the 64-bit integer value to write.
Exceptions:
IOException - if an I/O error occurs.
RuntimeException - if value is too large to be held in a 64-bit 2s complement number

writeLong

virtual void writeLong(long value)
Converts the given long integer value into a 2s complement, big-endian representation which is 4 bytes long and writes those bytes to this stream.

Parameters:
value - the long integer value to write.
Exceptions:
IOException - if an I/O error occurs.
RuntimeException - if value is too large to be held in a 32-bit 2s complement number

writeShort

virtual void writeShort(short value)
Converts the given short integer value into a 2s complement, big-endian representation which is 2 bytes long and writes those bytes to this stream.

Parameters:
value - the short integer value to write.
Exceptions:
IOException - if an I/O error occurs.
RuntimeException - if value is too large to be held in a 16-bit 2s complement number

writeUnsignedInt64

virtual void writeUnsignedInt64(UInt64Type value)
Converts the given 64-bit unsigned integer value into a 2s complement, big-endian representation which is 8 bytes long and writes those bytes to this stream.

Parameters:
value - the unsigned 64-bit integer value to write.
Exceptions:
IOException - if an I/O error occurs.
RuntimeException - if value is too large to be held in an unsigned 64-bit 2s complement number

writeUnsignedLong

virtual void writeUnsignedLong(unsigned long value)
Converts the given unsigned long integer value into a 2s complement, big-endian representation which is 4 bytes long and writes those bytes to this stream.

Parameters:
value - the unsigned long integer value to write.
Exceptions:
IOException - if an I/O error occurs.
RuntimeException - if value is too large to be held in an unsigned 32-bit 2s complement number

writeUnsignedShort

virtual void writeUnsignedShort(unsigned short value)
Converts the given unsigned short integer value into a 2s complement, big-endian representation which is 2 bytes long and writes those bytes to this stream.

Parameters:
value - the unsigned short integer value to write.
Exceptions:
IOException - if an I/O error occurs.
RuntimeException - if value is too large to be held in an unsigned 16-bit 2s complement number

writeUTF

virtual void writeUTF(const String& strValue)
Writes a Unicode String value in a length-prefixed UTF format. The UTF format is comprised of a 2-byte length field followed by length bytes in UTF-8 format. The String value is first encoded into a sequence of bytes in UTF-8 format. The length of this sequence is written to the stream as if by using the writeUnsignedShort() method. The encoded UTF-8 bytes are then written to the stream.

Exceptions:
IOException - if an I/O error occurs.
RuntimeException - if the length of the UTF-8 encoded sequence cannot be held in an unsigned 16-bit 2s complement number.
See also:
DataInput::readUTF()


Cross-Platform C++

Found a bug or missing feature? Please email us at support@elcel.com

Copyright © 2000-2005 ElCel Technology   Trademark Acknowledgements