Oracle Fusion Middleware C++ API Reference for Oracle Coherence
12c (12.1.2)

E26041-01

AbstractReadBuffer Class Reference

#include <coherence/io/AbstractReadBuffer.hpp>

Inherits Object, and ReadBuffer.

Inherited by AbstractOctetArrayReadBuffer.

List of all members.


Detailed Description

Abstract base implementation of the ReadBuffer interface.

Author:
jh 2007.12.31

Public Types

typedef spec::Handle Handle
 AbstractReadBuffer Handle definition.
typedef spec::View View
 AbstractReadBuffer View definition.
typedef spec::Holder Holder
 AbstractReadBuffer Holder definition.
typedef this_spec::Handle Handle
 ReadBuffer Handle definition.
typedef this_spec::View View
 ReadBuffer View definition.
typedef this_spec::Holder Holder
 ReadBuffer Holder definition.
typedef TypedHandle
< const
coherence::util::Binary
BinaryView
 Binary View definition.
typedef TypedHandle
< coherence::util::Binary
BinaryHandle
 Binary Handle definition.

Public Member Functions

virtual
BufferInput::Handle 
getBufferInput () const
 Get a BufferInput object to read data from this buffer.

Note that each call to this method will return a new BufferInput object, with the possible exception being that a zero-length ReadBuffer could always return the same instance (since there is nothing to read).

Returns:
a BufferInput that is reading from this buffer starting at offset zero

virtual ReadBuffer::View getReadBuffer (size32_t of, size32_t cb) const
 Obtain a ReadBuffer for a portion of this ReadBuffer.

Parameters:
of the beginning index, inclusive
cb the number of octets to include in the resulting ReadBuffer
Returns:
a ReadBuffer that represents a portion of this ReadBuffer
Exceptions:
IndexOutOfBoundsException if of + cb is larger than the length of this ReadBuffer

virtual BinaryView toBinary () const
 Returns a new Binary object that holds the complete contents of this ReadBuffer.

This is the equivalent of toBinary(0, length()).

Returns:
the contents of this ReadBuffer as a Binary object
Since:
Coherence 3.7.1

virtual BinaryView toBinary (size32_t of, size32_t cb) const
 Returns a Binary object that holds the specified portion of this ReadBuffer.

This is the equivalent of getReadBuffer(of, cb)->toBinary().

Parameters:
of the beginning index, inclusive
cb the number of octets to include in the Binary object
Returns:
a Binary object containing the specified portion of this ReadBuffer
Exceptions:
IndexOutOfBoundsException if of + cb is larger than the length of this ReadBuffer object
Since:
Coherence 3.7.1

virtual Array
< octet_t >::View 
toOctetArray () const
 Get the contents of the ReadBuffer as an octet array.

This is the equivalent of toOctetArray(0, length()).

Returns:
an octet array with the contents of this ReadBuffer object

virtual Array
< octet_t >::View 
toOctetArray (size32_t of, size32_t cb) const
 Get a portion of the contents of the ReadBuffer as an octet array.

Parameters:
of the beginning index, inclusive
cb the number of octets to include in the resulting array
Returns:
an octet array containing the specified portion of this ReadBuffer
Exceptions:
IndexOutOfBoundsException if of + cb is larger than the length of this ReadBuffer

virtual bool equals (Object::View v) const
 

Static Public Member Functions

static Array
< octet_t >::Handle 
getEmptyOctetArray ()
 An empty octet array (by definition immutable).
static BinaryHandle getEmptyBinary ()
 An empty Binary object.
static ReadBuffer::Handle getEmptyReadBuffer ()
 A zero-length ReadBuffer (by definition immutable).

Protected Member Functions

virtual ReadBuffer::View instantiateReadBuffer (size32_t of, size32_t cb) const =0
 Factory method: Instantiate a ReadBuffer for a portion of this ReadBuffer.
virtual
BufferInput::Handle 
instantiateBufferInput () const
 Factory method: Instantiate a BufferInput object to read data from the ReadBuffer.
virtual void checkBounds (size32_t of, size32_t cb) const
 Check if the specified read is within bounds.

Classes

class  AbstractBufferInput
 This is an implementation of the BufferInput interface that delegates its work back to its ReadBuffer. More...

Member Function Documentation

virtual ReadBuffer::View instantiateReadBuffer ( size32_t  of,
size32_t  cb 
) const [protected, pure virtual]

Factory method: Instantiate a ReadBuffer for a portion of this ReadBuffer.

Parameters:
of the beginning index, inclusive
cb the number of bytes to include in the resulting ReadBuffer
Returns:
a ReadBuffer that represents a portion of this ReadBuffer

Implemented in OctetArrayReadBuffer, and Binary.

virtual BufferInput::Handle instantiateBufferInput (  )  const [protected, virtual]

Factory method: Instantiate a BufferInput object to read data from the ReadBuffer.

Returns:
a new BufferInput reading from this ReadBuffer

Reimplemented in AbstractOctetArrayReadBuffer.

virtual void checkBounds ( size32_t  of,
size32_t  cb 
) const [protected, virtual]

Check if the specified read is within bounds.

Parameters:
of the absolute offset of the read operation
cb the length in bytes of the read operation
Exceptions:
IndexOutOfBoundsException if the specified read is not within bounds

static BinaryHandle getEmptyBinary (  )  [static]

An empty Binary object.

Since:
Coherence 3.7.1


The documentation for this class was generated from the following file:
Copyright © 2000, 2013, Oracle and/or its affiliates. All rights reserved.