In file bytarray.hxx:

namespace vos class OByteArray : public OObject

Array of bytes

Inheritance:


Public Methods

void* asPtr ()
return the address of the byte array.
virtual Boolean changeSize (long newSize)
Tell us to change our size, and return True if successful
virtual short Compare (const OByteArray& obj)
virtual long copyFrom (const void* pbuffer, long count, long position = 0)
Copy count bytes from pbuffer into our data segment, beginning at position in our data
long copyTo (void* buffer, long count, long position = 0)
Copy count bytes of our data, beginning at position pos, into buffer
long getCommonPrefixLength (const BYTE* p)
Return the size of the longest common prefix with the parameter
long getLength ()
synonym for getSize
long getLongValueAt (long index)
Obtain a long value from our array, beginning at the given position (i
short getShortValueAt (long index)
Extract a short value from our array, beginning at the given position, and return it
virtual long getSize ()
Return the number of bytes in the byte array.
OByteArray getSuffix (long index)
Return the suffix beginning at the given index (using 0-origin indexing)
OByteArray (void *pbuf, long size, Boolean resize = False)
OByteArray (const OByteArray& b)
OByteArray ()
operator BYTE* ()
virtual Boolean operator!= (const OByteArray& b)
virtual Boolean operator!= (const void* b)
OByteArray operator) (long index, long size)
Return the sub-array beginning at the given index (using 0-origin indexing) and of the given size
virtual Boolean operator< (const OByteArray& b)
virtual Boolean operator< (const void* b)
virtual Boolean operator<= (const void* b)
virtual Boolean operator<= (const OByteArray& b)
virtual OByteArray& operator= (long)
Copy the given long value into this ByteArray, beginning at position 0
virtual void operator= (const OByteArray& b)
Assign another byte array to this one.
virtual void operator= (const void* p)
Copy getSize() bytes from the given pointer position into this ByteArray
virtual OByteArray& operator= (short)
virtual Boolean operator== (const OByteArray& b)
Check if this ByteArray's contents are identical to those of b using the memcmp function
virtual Boolean operator== (const void* b)
This and other comparison methods that take character pointer arguments assume that the size of the memory segment pointed to by the parameter is the same as the size of this ByteArray
virtual Boolean operator> (const void* b)
virtual Boolean operator> (const OByteArray& b)
virtual Boolean operator>= (const OByteArray& b)
virtual Boolean operator>= (const void* b)
BYTE operator[] (long index)
Boolean readFrom (const OStream&)
Overrides the method inherited from Object
void setAllBytesTo (BYTE b)
Boolean writeTo (OStream&)
Overrides the method inherited from Object
~OByteArray ()

Inherited from OObject:

Public Methods

virtual const OClassInfo& getClassInfo()
Boolean isKindOf(const OClassInfo& rClass)
void operator delete(void* p)
void* operator new(size_t size)

Documentation

Array of bytes
OByteArray()

OByteArray(void *pbuf, long size, Boolean resize = False)

OByteArray(const OByteArray& b)

~OByteArray()

void setAllBytesTo(BYTE b)

virtual long getSize()
Return the number of bytes in the byte array.

long getLength()
synonym for getSize

operator BYTE* ()

void* asPtr()
return the address of the byte array.

BYTE operator[](long index)

virtual Boolean operator== (const OByteArray& b)
Check if this ByteArray's contents are identical to those of b using the memcmp function

virtual Boolean operator== (const void* b)
This and other comparison methods that take character pointer arguments assume that the size of the memory segment pointed to by the parameter is the same as the size of this ByteArray

virtual Boolean operator!= (const OByteArray& b)

virtual Boolean operator!= (const void* b)

virtual Boolean operator>= (const OByteArray& b)

virtual Boolean operator>= (const void* b)

virtual Boolean operator<= (const OByteArray& b)

virtual Boolean operator<= (const void* b)

virtual Boolean operator> (const OByteArray& b)

virtual Boolean operator> (const void* b)

virtual Boolean operator< (const OByteArray& b)

virtual Boolean operator< (const void* b)

virtual short Compare(const OByteArray& obj)

OByteArray operator) (long index, long size)
Return the sub-array beginning at the given index (using 0-origin indexing) and of the given size. Note that the returned ByteArray uses (part of) the same memory as this object, so it is possible to assign to the returned sub-array to effect copying into parts of this object. For example, with a ByteArray {\tt anArray}, you can write anArray(5, 4) = (ulong) 23; to put the value 23 as an unsigned long value (usually 4 bytes) in the cells 5 through 8. Also, assignment to sub-arrays does not change the size of the array itself.

OByteArray getSuffix(long index)
Return the suffix beginning at the given index (using 0-origin indexing). Note that the returned ByteArray uses (part of) the same memory as this ByteArray does.

long getLongValueAt(long index)
Obtain a long value from our array, beginning at the given position (i.e., treat the sizeof(long) bytes beginning at the given position as a long), and return it.

short getShortValueAt(long index)
Extract a short value from our array, beginning at the given position, and return it

long getCommonPrefixLength(const BYTE* p)
Return the size of the longest common prefix with the parameter

virtual void operator= (const OByteArray& b)
Assign another byte array to this one.

virtual void operator= (const void* p)
Copy getSize() bytes from the given pointer position into this ByteArray

virtual OByteArray& operator= (long)
Copy the given long value into this ByteArray, beginning at position 0. Do not copy more than getSize() bytes. This method, as well as the operator= on short and String, can be used in conjunction with the operator() to put values at arbitrary positions in the ByteArray.

virtual OByteArray& operator= (short)

virtual long copyFrom(const void* pbuffer, long count, long position = 0)
Copy count bytes from pbuffer into our data segment, beginning at position in our data. But do not copy any more than getSize() - position bytes. Return the actual number of bytes copied.

long copyTo(void* buffer, long count, long position = 0)
Copy count bytes of our data, beginning at position pos, into buffer. But do not copy any more than getSize() - position bytes. Return the actual number of bytes copied.

virtual Boolean changeSize(long newSize)
Tell us to change our size, and return True if successful. Since the ByteArray manages someone else's space and therefore cannot change its size, this method always returns False. It is overridden by the derived class ByteString.

Boolean readFrom(const OStream&)
Overrides the method inherited from Object. The implementation reads a passive representation of a ByteArray from the parameter Stream.

Boolean writeTo(OStream&)
Overrides the method inherited from Object. The implementation writes a passive representation of a ByteArray to the parameter Stream.


This class has no child classes.

alphabetic index hierarchy of classes


this page has been generated automatically by doc++

(c)opyright by Malte Zöckler, Roland Wunderling
contact: doc++@zib.de