RTI Connext Java API  Version 6.1.1

Instantiates com.rti.dds.infrastructure.com.rti.dds.util.Sequence < byte > More...

Inheritance diagram for ByteSeq:
AbstractPrimitiveSequence AbstractSequence Sequence Copyable Sequence

Public Member Functions

 ByteSeq ()
 Constructs an empty sequence of bytes with an initial maximum of zero. More...
 
 ByteSeq (int initialMaximum)
 Constructs an empty sequence of bytes with the given initial maximum. More...
 
 ByteSeq (byte[] bytes)
 Construct a new sequence containing the given bytes. More...
 
boolean addAllByte (byte[] elements, int offset, int length)
 Append length elements from the given array to this sequence, starting at index offset in that array. More...
 
boolean addAllByte (byte[] elements)
 
void addByte (byte element)
 Append the element to the end of the sequence. More...
 
void addByte (int index, byte element)
 Shift all elements in the sequence starting from the given index and add the element to the given index. More...
 
byte getByte (int index)
 Returns the byte at the given index. More...
 
byte setByte (int index, byte element)
 Set the new byte at the given index and return the old byte. More...
 
void setByte (int dstIndex, byte[] elements, int srcIndex, int length)
 Copy a portion of the given array into this sequence. More...
 
byte [] toArrayByte (byte[] array)
 Return an array containing copy of the contents of this sequence. More...
 
int getMaximum ()
 Get the current maximum number of elements that can be stored in this sequence. More...
 
Object get (int index)
 A wrapper for getByte(int) that returns a java.lang.Byte. More...
 
Object set (int index, Object element)
 A wrapper for setByte(). More...
 
void add (int index, Object element)
 A wrapper for addByte(int, int). More...
 
- Public Member Functions inherited from AbstractPrimitiveSequence
final Class getElementType ()
 
void loan (Object buffer, int new_length)
 Loan a contiguous buffer to this sequence. More...
 
void unloan ()
 Return the loaned buffer in the sequence and set the maximum to 0. More...
 
final boolean hasOwnership ()
 Return the value of the owned flag. More...
 
final void clear ()
 
final void setSize (int newSize)
 
final int size ()
 
final Object copy_from (Object src)
 
- Public Member Functions inherited from AbstractSequence
void setMaximum (int new_max)
 Resize this sequence to a new desired maximum. More...
 
Class getElementType ()
 
void add (int index, Object element)
 Inserts the specified element at the specified position in this sequence. More...
 
boolean add (Object element)
 Appends the specified element to the end of this sequence. More...
 
final Object remove (int index)
 Remove the element at the given index by shifting all subsequent elements "left" by one. More...
 

Detailed Description

Instantiates com.rti.dds.infrastructure.com.rti.dds.util.Sequence < byte >

Instantiates:
<<generic>> com.rti.dds.infrastructure.com.rti.dds.util.Sequence
See also
byte
com.rti.dds.infrastructure.com.rti.dds.util.Sequence

Constructor & Destructor Documentation

◆ ByteSeq() [1/3]

ByteSeq ( )

Constructs an empty sequence of bytes with an initial maximum of zero.

◆ ByteSeq() [2/3]

ByteSeq ( int  initialMaximum)

Constructs an empty sequence of bytes with the given initial maximum.

◆ ByteSeq() [3/3]

ByteSeq ( byte []  bytes)

Construct a new sequence containing the given bytes.

Parameters
bytesthe initial contents of this sequence
Exceptions
NullPointerExceptionif the input array is null

References ByteSeq.addAllByte().

Member Function Documentation

◆ addAllByte() [1/2]

boolean addAllByte ( byte []  elements,
int  offset,
int  length 
)

Append length elements from the given array to this sequence, starting at index offset in that array.

Exceptions
NullPointerExceptionif the given array is null.

Referenced by ByteSeq.addAllByte(), and ByteSeq.ByteSeq().

◆ addAllByte() [2/2]

boolean addAllByte ( byte []  elements)
Exceptions
NullPointerExceptionif the given array is null

References ByteSeq.addAllByte().

◆ addByte() [1/2]

void addByte ( byte  element)

Append the element to the end of the sequence.

Referenced by ByteSeq.add().

◆ addByte() [2/2]

void addByte ( int  index,
byte  element 
)

Shift all elements in the sequence starting from the given index and add the element to the given index.

◆ getByte()

byte getByte ( int  index)

Returns the byte at the given index.

Exceptions
IndexOutOfBoundsExceptionif the index is out of bounds.

Referenced by ByteSeq.get().

◆ setByte() [1/2]

byte setByte ( int  index,
byte  element 
)

Set the new byte at the given index and return the old byte.

Exceptions
IndexOutOfBoundsExceptionif the index is out of bounds.

Referenced by ByteSeq.set().

◆ setByte() [2/2]

void setByte ( int  dstIndex,
byte []  elements,
int  srcIndex,
int  length 
)

Copy a portion of the given array into this sequence.

Parameters
dstIndexthe index at which to start copying into this sequence.
elementsan array of primitive elements.
srcIndexthe index at which to start copying from the given array.
lengththe number of elements to copy.
Exceptions
IndexOutOfBoundsExceptionif copying would cause access of data outside array bounds.

◆ toArrayByte()

byte [] toArrayByte ( byte []  array)

Return an array containing copy of the contents of this sequence.

Parameters
arrayThe array into which this sequence should be copied. It may be null. If it is, or if array length is too small, the array will be ignored, and a new array of the necessary length will be created and copied into instead.
Returns
A non-null array containing a copy of the contents of this sequence.

◆ getMaximum()

int getMaximum ( )

Get the current maximum number of elements that can be stored in this sequence.

The maximum of the sequence represents the maximum number of elements that the underlying buffer can hold. It does not represent the current number of elements.

The maximum is a non-negative number. It is initialized when the sequence is first created.

The maximum can be changed implicitly by adding an element to the sequence with add(), or explicitly by calling com.rti.dds.infrastructure.com.rti.dds.util.Sequence.Sequence.setMaximum.

Returns
the current maximum of the sequence.
See also
com.rti.dds.infrastructure.com.rti.dds.util.Sequence.Sequence.size()

Implements Sequence.

Referenced by DynamicData.get_byte_seq(), DynamicData.set_byte_seq(), and DynamicData.to_cdr_buffer().

◆ get()

Object get ( int  index)

A wrapper for getByte(int) that returns a java.lang.Byte.

See also
java.util.List::get(int)

References ByteSeq.getByte(), and AbstractPrimitiveSequence.size().

◆ set()

Object set ( int  index,
Object  element 
)

A wrapper for setByte().

Exceptions
ClassCastExceptionif the element is not of type Byte.
See also
java.util.List::set(int, java.lang.Object)

References ByteSeq.setByte().

◆ add()

void add ( int  index,
Object  element 
)

A wrapper for addByte(int, int).

Exceptions
ClassCastExceptionif the element is not of type Byte.
See also
java.util.List::add(int, java.lang.Object)

References ByteSeq.addByte().