Skip Headers

Oracle C++ Call Interface Programmer's Guide
Release 2 (9.2)

Part Number A96583-01
Go To Documentation Library
Home
Go To Product List
Book List
Go To Table Of Contents
Contents
Go To Index
Index

Master Index

Feedback

Go to previous page Go to beginning of chapter Go to next page

OCCI Classes and Methods, 4 of 22


Bytes Class

Methods of the Bytes class enable you to perform specific tasks related to Bytes objects.

To create a Bytes object, use the syntax:

Bytes(Environment *env = NULL);

To create a Bytes object that contains a subarray of bytes from a character array, use the syntax:

Bytes(unsigned char *value,
   unsigned int count,
   unsigned int offset = 0,
   Environment *env = NULL);

To create a copy of a Bytes object, use the syntax:

Bytes(const Bytes &e);

Summary of Bytes Methods

Table 8-4 Bytes Methods  
Method Summary

byteAt()

Return the byte at the specified position of the Bytes object.

getBytes()

Return a byte array from the Bytes object.

isNull()

Test whether the Bytes object is null.

length()

Return the number of bytes in the Bytes object.

setNull()

Set the Bytes object to null.

byteAt()

This method returns the byte at the specified position in the Bytes object.

Syntax
unsigned char byteAt(unsigned int index) const;
Parameters
index

The position of the byte to be returned from the Bytes object; the first byte of the Bytes object is at 0.

getBytes()

This method copies bytes from a Bytes object into the specified byte array.

Syntax
void getBytes(unsigned char *dst,
   unsigned int count,
   unsigned int srcBegin = 0,
   unsigned int dstBegin = 0) const;
Parameters
dst

The destination buffer into which data from the Bytes object is to be written.

count

The number of bytes to copy.

srcBegin

The starting position at which data is to be read from the Bytes object; the position of the first byte in the Bytes object is at 0.

dstBegin

The starting position at which data is to be written in the destination buffer; the position of the first byte in dst is at 0.

isNull()

This method tests whether the Bytes object is atomically null. If the Bytes object is atomically null, then true is returned; otherwise false is returned.

Syntax
bool isNull() const;

length()

This method returns the length of the Bytes object.

Syntax
unsigned int length() const;

setNull()

This method sets the Bytes object to atomically null.

Syntax
void setNull();


Go to previous page Go to beginning of chapter Go to next page
Oracle
Copyright © 2001, 2002 Oracle Corporation.

All Rights Reserved.
Go To Documentation Library
Home
Go To Product List
Book List
Go To Table Of Contents
Contents
Go To Index
Index

Master Index

Feedback