#include <coherence/io/AbstractOctetArrayReadBuffer.hpp>
Inherits AbstractReadBuffer.
Inherited by OctetArrayReadBuffer, and Binary.
This implementation is not intended to be thread safe.
Public Types | |||||||||||||||||||
| typedef spec::Handle | Handle | ||||||||||||||||||
| AbstractOctetArrayReadBuffer Handle definition. | |||||||||||||||||||
| typedef spec::View | View | ||||||||||||||||||
| AbstractOctetArrayReadBuffer View definition. | |||||||||||||||||||
| typedef spec::Holder | Holder | ||||||||||||||||||
| AbstractOctetArrayReadBuffer Holder definition. | |||||||||||||||||||
| typedef this_spec::Handle | Handle | ||||||||||||||||||
| AbstractReadBuffer Handle definition. | |||||||||||||||||||
| typedef this_spec::View | View | ||||||||||||||||||
| AbstractReadBuffer View definition. | |||||||||||||||||||
| typedef this_spec::Holder | Holder | ||||||||||||||||||
| AbstractReadBuffer Holder definition. | |||||||||||||||||||
|
typedef TypedHandle < const coherence::util::Binary > | BinaryView | ||||||||||||||||||
| Binary View definition. | |||||||||||||||||||
Public Member Functions | |||||||||||||||||||
| virtual size32_t | length () const | ||||||||||||||||||
| Determine the length of the buffer.
| |||||||||||||||||||
| virtual octet_t | read (size32_t of) const | ||||||||||||||||||
| Returns the octet at the specified offset.
An offset ranges from
| |||||||||||||||||||
| virtual void | read (size32_t ofBegin, size32_t ofEnd, Array< octet_t >::Handle habDest, size32_t ofDest) const | ||||||||||||||||||
| Copies octets from this ReadBuffer into the destination octet array.
The first octet to be copied is at offset
ofDest + (ofEnd - ofBegin) - 1
This method allows the caller to extract a chunk of octets into the caller's own array.
| |||||||||||||||||||
| virtual BinaryView | toBinary () const | ||||||||||||||||||
| Returns a new Binary object that holds the complete contents of this ReadBuffer.
This is the equivalent of
| |||||||||||||||||||
| 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
| |||||||||||||||||||
|
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.
| |||||||||||||||||||
| virtual bool | equals (Object::View v) const | ||||||||||||||||||
Static Public Attributes | |||||||||||||||||||
| static const size32_t | npos | ||||||||||||||||||
| The largest possible value of type size32_t. | |||||||||||||||||||
Protected Member Functions | |||||||||||||||||||
| AbstractOctetArrayReadBuffer () | |||||||||||||||||||
| Default constructor; intended for deserialization use by subclasses. | |||||||||||||||||||
| AbstractOctetArrayReadBuffer (Array< octet_t >::View vab, size32_t of=0, size32_t cb=npos) | |||||||||||||||||||
| Construct an AbstractOctetArrayReadBuffer on a portion of an octet Array. | |||||||||||||||||||
|
virtual BufferInput::Handle | instantiateBufferInput () const | ||||||||||||||||||
| Factory method: Instantiate a BufferInput object to read data from the ReadBuffer.
| |||||||||||||||||||
| virtual void | resetRange (size32_t of, size32_t cb) | ||||||||||||||||||
| Reset the portion of the octet array the ReadBuffer operates upon. | |||||||||||||||||||
Protected Attributes | |||||||||||||||||||
| FinalView< Array < octet_t > > | f_vab | ||||||||||||||||||
| The octet array that holds the binary data. | |||||||||||||||||||
| size32_t | m_of | ||||||||||||||||||
| Offset into the octet array at which the binary data is located. | |||||||||||||||||||
| size32_t | m_cb | ||||||||||||||||||
| Number of octets in the octet array that belong to this ReadBuffer object. | |||||||||||||||||||
Classes | |||||||||||||||||||
| class | OctetArrayBufferInput | ||||||||||||||||||
| This is an implementation of the BufferInput interface on top of an octet array. More... | |||||||||||||||||||
| AbstractOctetArrayReadBuffer | ( | ) | [protected] |
Default constructor; intended for deserialization use by subclasses.
Note that this default constructor leaves the buffer in an invalid state.
| AbstractOctetArrayReadBuffer | ( | Array< octet_t >::View | vab, | |
| size32_t | of = 0, |
|||
| size32_t | cb = npos | |||
| ) | [protected] |
Construct an AbstractOctetArrayReadBuffer on a portion of an octet Array.
| vab | an Array of octets | |
| of | an offset into the octet array | |
| cb | the number of octets to utilize or npos for (vab->length - of) |
| IndexOutOfBoundsException | if of + cb is larger than vab->length | |
| NullPointerException | if vab is NULL |
| virtual void resetRange | ( | size32_t | of, | |
| size32_t | cb | |||
| ) | [protected, virtual] |
Reset the portion of the octet array the ReadBuffer operates upon.
| of | an offset into the octet array | |
| cb | the number of octets to utilize |
| IndexOutOfBoundsException | if of + cb is larger than the buffer's length |
The octet array that holds the binary data.
This value should not be changed.
size32_t m_of [protected] |
Offset into the octet array at which the binary data is located.
This value should not be changed.
size32_t m_cb [protected] |
Number of octets in the octet array that belong to this ReadBuffer object.
This value should not be changed.