Oracle Coherence for C++ API
Release 3.6.0.0
E15728-01

- Main Page
- Namespaces
- Classes
- Files

- Alphabetical List
- Class List
- Class Hierarchy
- Class Members

# ReadBuffer::BufferInput Class Reference

`#include <coherence/io/ReadBuffer.hpp>`

Inherits Object.

List of all members.

## Detailed Description

The BufferInput interface represents a data input stream on top of a ReadBuffer.

Author:
  jh 2007.12.20

## Public Types
typedef spec::Handle | Handle
| BufferInput Handle definition.
typedef spec::View | View
| BufferInput View definition.
typedef spec::Holder | Holder
| BufferInput Holder definition.
## Public Member Functions
virtual ReadBuffer::View | getBuffer () const =0
| Get the ReadBuffer object that this BufferInput is reading from.
virtual size32_t | getOffset () const =0
| Determine the current offset of this BufferInput within the underlying ReadBuffer.
virtual void | setOffset (size32_t of)=0
| Specify the offset of the next octet to read from the underlying ReadBuffer.
virtual size32_t | available () const =0
| Returns the number of octets that can be read (or skipped over) from this input stream before the end of the stream is reached.
virtual void | skip (size32_t cb)=0
| Skips over the specified number of octets of data.
virtual octet_t | read ()=0
| Read an octet value.
virtual void | read (Array< octet_t >::Handle hab)=0
| Read `hab->length` octets and store them in `hab`.
virtual void | read (Array< octet_t >::Handle hab, size32_t of, size32_t cb)=0
| Read `cb` octets from the input stream and store them into the passed array `hab` starting at offset `of`.
virtual ReadBuffer::View | readBuffer (size32_t cb)=0
| Read `cb` octets and return them as a ReadBuffer object.
virtual bool | readBoolean ()=0
| Read a boolean value.
virtual char16_t | readChar16 ()=0
| Read a 16-bit Unicode character value.
virtual String::View | readString ()=0
| Read a sequence of UTF-8 encoded 16-bit Unicode characters.
virtual int16_t | readInt16 ()=0
| Read a 16-bit integer value.
virtual int32_t | readInt32 ()=0
| Read a 32-bit integer value.
virtual int64_t | readInt64 ()=0
| Read a 64-bit integer value.
virtual float32_t | readFloat32 ()=0
| Read a 32-bit floating-point value.
virtual float64_t | readFloat64 ()=0
| Read a 64-bit floating-point value.

## Member Function Documentation

virtual ReadBuffer::View getBuffer | ( |  | ) | const `[pure virtual]`

Get the ReadBuffer object that this BufferInput is reading from.

Returns:
  the underlying ReadBuffer object

virtual size32_t getOffset | ( |  | ) | const `[pure virtual]`

Determine the current offset of this BufferInput within the underlying ReadBuffer.

Returns:
  the offset of the next octet to read from the ReadBuffer

virtual void setOffset | ( | size32_t | of | ) | `[pure virtual]`

Specify the offset of the next octet to read from the underlying ReadBuffer.

Parameters:

  | of | the offset of the next octet to read from the ReadBuffer

Exceptions:

  | IndexOutOfBoundsException | if `of > getBuffer()->length()`

virtual size32_t available | ( |  | ) | const `[pure virtual]`

Returns the number of octets that can be read (or skipped over) from this input stream before the end of the stream is reached.

Returns:
  the number of octets that can be read (or skipped over) from this BufferInput

virtual void skip | ( | size32_t | cb | ) | `[pure virtual]`

Skips over the specified number of octets of data.

Parameters:

  | cb | the number of octets to skip over

Exceptions:

  | EOFException | if the stream is exhausted before the number of octets indicated could be skipped
  | IOException | if an I/O error occurs

virtual octet_t read | ( |  | ) | `[pure virtual]`

Read an octet value.

Returns:
  an `octet_t` value

Exceptions:

  | EOFException | if the value could not be read because no more data remains to be read
  | IOException | if an I/O error occurs

virtual void read | ( | Array< octet_t >::Handle | hab | ) | `[pure virtual]`

Read `hab->length` octets and store them in `hab`.

Parameters:

  | hab | the array to store the octets which are read from the stream

Exceptions:

  | NullPointerException | if the passed array is NULL
  | EOFException | if the stream is exhausted before the number of octets indicated by the array length could be read
  | IOException | if an I/O error occurs

virtual void read | ( | Array< octet_t >::Handle | hab,
|  | size32_t | of,
|  | size32_t | cb |
| ) |  |  | `[pure virtual]`

Read `cb` octets from the input stream and store them into the passed array `hab` starting at offset `of`.

Parameters:

  | hab | the array to store the octets which are read from the stream
  | of | the offset into the array that the read octets will be stored
  | cb | the number of octets to read

Exceptions:

  | NullPointerException | if the passed array is NULL
  | IndexOutOfBoundsException | if `of+cb` is greater than the length of the `hab`
  | EOFException | if the stream is exhausted before the number of octets indicated could be read
  | IOException | if an I/O error occurs

virtual ReadBuffer::View readBuffer | ( | size32_t | cb | ) | `[pure virtual]`

Read `cb` octets and return them as a ReadBuffer object.

Parameters:

  | cb | the number of octets to read

Returns:
  a ReadBuffer object composed of `cb` octets read from the BufferInput

Exceptions:

  | EOFException | if the stream is exhausted before the number of octets indicated could be read
  | IOException | if an I/O error occurs

virtual bool readBoolean | ( |  | ) | `[pure virtual]`

Read a boolean value.

Returns:
  either `true` or `false`

Exceptions:

  | EOFException | if the value could not be read because no more data remains to be read
  | IOException | if an I/O error occurs

virtual char16_t readChar16 | ( |  | ) | `[pure virtual]`

Read a 16-bit Unicode character value.

Returns:
  a 16-bit Unicode character as a `char16_t` value

Exceptions:

  | EOFException | if the value could not be read because no more data remains to be read
  | IOException | if an I/O error occurs

virtual String::View readString | ( |  | ) | `[pure virtual]`

Read a sequence of UTF-8 encoded 16-bit Unicode characters.

Returns:
  a String value; may be NULL

Exceptions:

  | IOException | if an I/O error occurs

virtual int16_t readInt16 | ( |  | ) | `[pure virtual]`

Read a 16-bit integer value.

Returns:
  an `int16_t` value

Exceptions:

  | EOFException | if the value could not be read because no more data remains to be read
  | IOException | if an I/O error occurs

virtual int32_t readInt32 | ( |  | ) | `[pure virtual]`

Read a 32-bit integer value.

Returns:
  an `int32_t` value

Exceptions:

  | EOFException | if the value could not be read because no more data remains to be read
  | IOException | if an I/O error occurs

virtual int64_t readInt64 | ( |  | ) | `[pure virtual]`

Read a 64-bit integer value.

Returns:
  an `int64_t` value

Exceptions:

  | EOFException | if the value could not be read because no more data remains to be read
  | IOException | if an I/O error occurs

virtual float32_t readFloat32 | ( |  | ) | `[pure virtual]`

Read a 32-bit floating-point value.

Returns:
  a `float32_t` value

Exceptions:

  | EOFException | if the value could not be read because no more data remains to be read
  | IOException | if an I/O error occurs

virtual float64_t readFloat64 | ( |  | ) | `[pure virtual]`

Read a 64-bit floating-point value.

Returns:
  a `float64_t` value

Exceptions:

  | EOFException | if the value could not be read because no more data remains to be read
  | IOException | if an I/O error occurs

The documentation for this class was generated from the following file:

- coherence/io/ReadBuffer.hpp

Copyright © 2000, 2010, Oracle and/or its affiliates. All rights reserved.