RTI Connext Java API  Version 6.1.1

Built-in type consisting of a variable-length array of opaque bytes. More...

Inheritance diagram for Bytes:
Copyable

Public Member Functions

 Bytes ()
 Default Constructor. More...
 
 Bytes (Bytes src)
 Copy constructor. More...
 
 Bytes (int theLength)
 Constructor that specifies the size of the allocated bytes array. More...
 
 Bytes (byte[] src)
 
Object copy_from (Object src)
 Copy src into this object. More...
 

Public Attributes

int length
 Number of bytes to serialize. More...
 
int offset
 Offset from which to start serializing bytes. More...
 
byte [] value
 com.rti.dds.type.builtin.com.rti.dds.type.builtin.Bytes array value. More...
 

Detailed Description

Built-in type consisting of a variable-length array of opaque bytes.

Constructor & Destructor Documentation

◆ Bytes() [1/4]

Bytes ( )

Default Constructor.

The default constructor initializes the newly created object with null value, zero length, and zero offset.

Referenced by Bytes.copy_from().

◆ Bytes() [2/4]

Bytes ( Bytes  src)

Copy constructor.

Parameters
src<<in>> Object to copy from.
Exceptions
NullPointerExceptionif src is null.

References Bytes.copy_from().

◆ Bytes() [3/4]

Bytes ( int  theLength)

Constructor that specifies the size of the allocated bytes array.

After this method is called, length and offset are set to zero.

Parameters
theLength<<in>> Size of the allocated bytes array.
Exceptions
IllegalArgumentExceptionif size is negative

◆ Bytes() [4/4]

Bytes ( byte []  src)

Create a new Bytes object to wrap the given array.

The value field will point to the given array. The offset will be set to 0. The length will be set to the length of the array unless the array is null, in which case the length will be set to 0 also.

Member Function Documentation

◆ copy_from()

Object copy_from ( Object  src)

Copy src into this object.

This method performs a deep copy of src and it allocates memory for the value if required.

Parameters
src<<in>> Object to copy from.
Returns
this if success. Otherwise, null.
Exceptions
NullPointerExceptionif src is null.

Implements Copyable.

References Bytes.Bytes(), Bytes.length, Bytes.offset, and Bytes.value.

Referenced by Bytes.Bytes(), and BytesTypeSupport.get_type_name().

Member Data Documentation

◆ length

◆ offset

int offset

Offset from which to start serializing bytes.

The first position of the bytes array has offset 0.

Referenced by Bytes.copy_from(), BytesTypeSupport.data_to_string(), BytesTypeSupport.get_type_name(), BytesDataWriter.write(), and BytesDataWriter.write_w_timestamp().

◆ value

byte [] value

com.rti.dds.type.builtin.com.rti.dds.type.builtin.Bytes array value.

Referenced by Bytes.copy_from(), BytesTypeSupport.data_to_string(), BytesTypeSupport.get_type_name(), BytesDataWriter.write(), and BytesDataWriter.write_w_timestamp().