mpjbuf
Class Buffer

java.lang.Object
  extended by mpjbuf.Buffer

public class Buffer
extends java.lang.Object

A buffer object, for holding an mpjdev message.

Through appropriate use of sections, described below, a single buffer object can contain a mixture of elements of any Java type. A single buffer object can be reused both for sending and receiving messages, although at any given time a buffer is either in a readable state or a writeable state. A buffer is created with a fixed static capacity which does not change during the lifetime of the buffer. However a buffer can also (under user control) store data in a dynamically allocated region---this is necessary in particular to support serialized objects. A characteristic feature of the mpjbuf.Buffer is that is supports transfer of data from and to non-contiguous sections of a Java array through various gather and scatter methods.

Sections

A message is considered to consist of zero or more "sections". Each section holds a sequence of elements which are either all of the same primitive type, or all have Object type. When a buffer is in writeable mode, a new section is started by invoking putSectionHeader() to mark the start of the section. This is followed by a series write(), gather(), and/or strGather() operations to write the data to the section. When a buffer is in readable mode, one starts reading a section by invoking getSectionHeader() to determine the type of elements in the next section, and to make it the current section. This is followed by a series read(), scatter(), and/or strScatter() operations to read the data from the section. Buffers may only be written and read sequentially, from beginning to end.

In general a buffer object comprises two regions: a primary or static buffer, and a secondary or dynamic buffer. The static buffer has a fixed capacity, specified when the buffer is created. The size of the dynamic buffer grows automatically as new data is written to it. Any section can be created as a static section or a dynamic section, and this controls which region of the buffer the section data is stored in. It is important to note that in general writing to or reading from a static section is much faster than the corresponding operation on a dynamic section. Dynamic sections are required to support storing serialized objects in the buffer. As a convenience to the programmer, dynamic sections holding primitive types are also supported. But in general use of the dynamic buffer is is only recommended for short or infrequent message exchanges.

Physical layout of buffer

Numeric data in the static buffer can be represented in big-endian or little-endian format. This is determined by the encoding property of the buffer, which takes on of the values java.nio.ByteOrder.BIG_ENDIAN or java.nio.ByteOrder.LITTLE_ENDIAN. The encoding property of a newly created buffer is determined by the return value of java.nio.ByteOrder.nativeOrder().

The overall layout of the static buffer is illustrated in the following figure:

In practise many messages will contain only a single section. There are up to 7 bytes of padding after each section to ensure that the next section header begins on a boundary that is a multiple of ALIGNMENT_UNIT, which has value 8.

The general layout of an individual section in the static buffer is illustrated in the following figure:

The first byte of the section header defines the type of the section, encoding one of the possible values BYTE, CHAR, SHORT, BOOLEAN, INT, LONG, FLOAT, or DOUBLE, if the section is static, or one of OBJECT, BYTE_DYNAMIC, CHAR_DYNAMIC, SHORT_DYNAMIC, BOOLEAN_DYNAMIC, INT_DYNAMIC, LONG_DYNAMIC, FLOAT_DYNAMIC, or DOUBLE_DYNAMIC if the section is dynamic. The second 4 bytes of the header holds the number of elements in the section. This numeric value is represented according to the encoding property of the buffer. The size of the header in bytes is SECTION_OVERHEAD, which has value 8. If the section is static, the header is followed by the values of the elements, again represented according to the encoding property of the buffer. If the section is dynamic, the "Section data" is absent from the diagram above (because the data is in the dynamic buffer).

The format of the dynamic buffer is entirely determined by the standard Java serialization classes java.io.ObjectOutputStream and java.io.ObjectInputStream.

Read and write operations

There are 3 basic kinds of operation for writing data to a buffer section, and 3 basic kinds of operation for reading data from a buffer section. The simplest data transfer operations are write() and read(), which transfer contiguous sections of a Java array. The generic forms are respectively:

    write(type[] source,
          int srcOff,
          int numEls)
   
and

    read(type[] dest,
         int dstOff,
         int numEls)
   
The write() operation copies the values of elements:

    source [srcOff], source [srcOff + 1], ..., source [srcOff + numEls - 1]
   
to the buffer, in the order shown. Conversely the read(), operation reads numEls values from the buffer and writes them to the elements:

    dest [dstOff], dest [dstOff + 1], ..., dest [dstOff + numEls - 1]
   

The operations gather() and scatter() transfer data from or to a subset of elements of a Java array, selected by giving an index vector. The generic forms are respectively:


    gather(type[] source,
           int numEls,
           int idxOff,
           int[] indexes)
   
and

    scatter(type[] dest,
            int numEls,
            int idxOff,
            int[] indexes)
   
The gather() operation copies the values of elements:

    source [indexes [idxOff]], source [indexes [idxOff + 1]], ..., source [indexes [idxOff + numEls - 1]]
   
to the buffer, in the order shown. Conversely the scatter() operation reads numEls values from the buffer and writes them to the elements:

    dest [indexes [idxOff]], dest [indexes [idxOff + 1]], ..., dest [indexes [idxOff + numEls - 1]]
   

The operations strGather() and strScatter() likewise transfer data from or to a subset of elements of a Java array, but in these cases the selected subset is a "multi-strided region" of the Java array. The specification is fairly complex, but these are useful operations for dealing with multidimensional data structures, which occur often in scientific programming. The generic forms are respectively:


    strGather(type[] source,
              int srcOff,
              int rank,
              int exts,
              int srs,
              int[] shape)
   
and

    strScatter(type[] dest,
               int dstOff,
               int rank,
               int exts,
               int srs,
               int[] shape)
   
A multi-strided region is characterized a rank, or dimensionality, which we will call r. The detailed shape of the region is represented by a vector of r extents or sizes, which we will call n1, n2, ..., nr, and a vector of r strides, which we will call s1, s2, ..., sr.

In the one dimensional case (r = 1), for example, a strGather() operation copies values of the elements:


    source[srcOff], source[srcOff + s1], ..., source[srcOff + (n1 - 1)s1],
   
to the buffer, in the order shown. Conversely a rank-1 strScatter() operation reads n1 values from the buffer and writes them to the elements:

    dest[dstOff], dest[dstOff + s1], ..., dest[dstOff + (n1 - 1)s1],
   
In the two dimensional case, a strGather() operation copies values of the elements:

    source[srcOff], source[srcOff + s2], ..., source[srcOff + (n2 - 1)s2],
    source[srcOff + s1], source[srcOff + s1 + s2], ..., source[srcOff + s1 + (n2 - 1)s2],
    ...,
    source[srcOff + (n1 - 1)s1], source[srcOff + (n1 - 1)s1 + s2], ..., source[srcOff + (n1 - 1)s1 + (n2 - 1)s2]
   
to the buffer, in the order shown. A rank-2 strScatter() operation reads n1 n2 values from the buffer and writes them to the elements:

    dest[dstOff], dest[dstOff + s2], ..., dest[dstOff + (n2 - 1)s2],
    dest[dstOff + s1], dest[dstOff + s1 + s2], ..., dest[dstOff + s1 + (n2 - 1)s2],
    ...,
    dest[dstOff + (n1 - 1)s1], dest[dstOff + (n1 - 1)s1 + s2], ..., dest[dstOff + (n1 - 1)s1 + (n2 - 1)s2]
   
This pattern generalizes to any rank. In the concrete parameters lists, the sizes n1, n2, ..., nr are given by the shape elements:

    shape[exts], shape[exts + 1], ..., shape[exts + rank - 1]
   
and the strides s1, s2, ..., sr are given by the shape elements:

    shape[strs], shape[strs + 1], ..., shape[strs + rank - 1]
   

Read-write modes

When a buffer object is initially created, the buffer is in a writable state. In this state, new sections and data can be added to the buffer. However read operations are not allowed while a buffer is in the writable state. When writing is completed, the commit() method "freezes" the buffer, putting it in a readable state, and moves the read pointer to the start of the buffer. Now read operations can begin; but write operations are no longer allowed.

After the data has been read, you may want to put the buffer back into a writable state, ready for more data. To do this use the clear() method. This erases the original data, and moves the write pointer to the start of the buffer. If on the other hand you need to re-read the same buffer contents from the beginning, the commit() method can be called again to rewind the read pointer back to the start of the buffer, without changing contents.

Miscellany

Where consistent with efficiency, operations reading from or writing to the buffer attempt to check whether the operation will succeed before transfering any data. In some circumstances this is difficult to guarantee; if an operation resulting in an exception does result in a partial read or write, subsequent calls to getRemaining() or getSectionSize() will generally reflect how much data was transferred before the exception occurred. But even this behavior cannot be guaranteed in the case of OBJECT sections, where an individual object may be incompletely transferred.


Field Summary
static int ALIGNMENT_UNIT
           
static int SECTION_OVERHEAD
           
 
Constructor Summary
protected Buffer()
          Default constructor
  Buffer(int capacity)
          Creates a buffer with specified static capacity, and static buffer encoding given by java.nio.ByteOrder.nativeEncoding().
  Buffer(RawBuffer buffer, int bufoffset, int capacity)
          Creates a buffer with specified rawbuffer, and staring at the offset specified.
 
Method Summary
 void clear()
          Empty the buffer and put it in a writeable state.
 void commit()
          Freeze buffer, putting it into a readable state, and setting the read pointer to the start of the buffer.
 void copy(java.nio.ByteBuffer srcStaticBuffer, int srcOffset, int staticBufferLength, int dstOffset, byte[] srcDynamicBuffer, int dynamicBufferLength)
           
 void free()
          Free resources associated with this buffer.
 void gather(boolean[] source, int numEls, int idxOff, int[] indexes)
          Append numEls selected boolean elements from array source to the current section of buffer.
 void gather(byte[] source, int numEls, int idxOff, int[] indexes)
          Append numEls selected byte elements from array source to the current section of buffer.
 void gather(char[] source, int numEls, int idxOff, int[] indexes)
          Append numEls selected char elements from array source to the current section of buffer.
 void gather(double[] source, int numEls, int idxOff, int[] indexes)
          Append numEls selected double elements from array source to the current section of buffer.
 void gather(float[] source, int numEls, int idxOff, int[] indexes)
          Append numEls selected float elements from array source to the current section of buffer.
 void gather(int[] source, int numEls, int idxOff, int[] indexes)
          Append numEls selected int elements from array source to the current section of buffer.
 void gather(long[] source, int numEls, int idxOff, int[] indexes)
          Append numEls selected long elements from array source to the current section of buffer.
 void gather(java.lang.Object[] source, int numEls, int idxOff, int[] indexes)
          Append numEls selected Object elements from array source to the current section of buffer.
 void gather(short[] source, int numEls, int idxOff, int[] indexes)
          Append numEls selected short elements from array source to the current section of buffer.
 byte[] getDynamicBuffer()
          Get bytes of the dynamic buffer.
 java.nio.ByteOrder getEncoding()
          Returns encoding of numeric data in the static buffer.
 int getRemaining()
          Returns number of elements remaining to be read in the current section.
 Type getSectionHeader()
          Read a section header from the buffer, and make this the current section.
 int getSectionSize()
          Size of current section.
 int getSize()
          Get total number of bytes of data currently in the static buffer.
 RawBuffer getStaticBuffer()
          Returns a representation of the static buffer.
 boolean isWritable()
          Determine read-write mode of buffer.
 int offset()
           
 void putSectionHeader(Type type)
          Start a new section in the buffer: write a section header to the buffer and make the new section the current section.
 void read(boolean[] dest, int dstOff, int numEls)
          Read the next numEls boolean items from the current section of the buffer, and write them to consecutive elements of the array dest, starting at index dstOff.
 void read(byte[] dest, int dstOff, int numEls)
          Read the next numEls byte items from the current section of the buffer, and write them to consecutive elements of the array dest, starting at index dstOff.
 void read(char[] dest, int dstOff, int numEls)
          Read the next numEls char items from the current section of the buffer, and write them to consecutive elements of the array dest, starting at index dstOff.
 void read(double[] dest, int dstOff, int numEls)
          Read the next numEls double items from the current section of the buffer, and write them to consecutive elements of the array dest, starting at index dstOff.
 void read(float[] dest, int dstOff, int numEls)
          Read the next numEls float items from the current section of the buffer, and write them to consecutive elements of the array dest, starting at index dstOff.
 void read(int[] dest, int dstOff, int numEls)
          Read the next numEls int items from the current section of the buffer, and write them to consecutive elements of the array dest, starting at index dstOff.
 void read(long[] dest, int dstOff, int numEls)
          Read the next numEls long items from the current section of the buffer, and write them to consecutive elements of the array dest, starting at index dstOff.
 void read(java.lang.Object[] dest, int dstOff, int numEls)
          Read the next numEls Object items from the current section of the buffer, and write them to consecutive elements of the array dest, starting at index dstOff.
 void read(short[] dest, int dstOff, int numEls)
          Read the next numEls short items from the current section of the buffer, and write them to consecutive elements of the array dest, starting at index dstOff.
 void scatter(boolean[] dest, int numEls, int idxOff, int[] indexes)
          Read the next numEls boolean items from the current section of the buffer, and write them to selected elements of the array dest.
 void scatter(byte[] dest, int numEls, int idxOff, int[] indexes)
          Read the next numEls byte items from the current section of the buffer, and write them to selected elements of the array dest.
 void scatter(char[] dest, int numEls, int idxOff, int[] indexes)
          Read the next numEls char items from the current section of the buffer, and write them to selected elements of the array dest.
 void scatter(double[] dest, int numEls, int idxOff, int[] indexes)
          Read the next numEls double items from the current section of the buffer, and write them to selected elements of the array dest.
 void scatter(float[] dest, int numEls, int idxOff, int[] indexes)
          Read the next numEls float items from the current section of the buffer, and write them to selected elements of the array dest.
 void scatter(int[] dest, int numEls, int idxOff, int[] indexes)
          Read the next numEls int items from the current section of the buffer, and write them to selected elements of the array dest.
 void scatter(long[] dest, int numEls, int idxOff, int[] indexes)
          Read the next numEls long items from the current section of the buffer, and write them to selected elements of the array dest.
 void scatter(java.lang.Object[] dest, int numEls, int idxOff, int[] indexes)
          Read the next numEls Object items from the current section of the buffer, and write them to selected elements of the array dest.
 void scatter(short[] dest, int numEls, int idxOff, int[] indexes)
          Read the next numEls short items from the current section of the buffer, and write them to selected elements of the array dest.
 void setDynamicBuffer(byte[] dynamicBuffer)
          Set bytes of the dynamic buffer.
 void setEncoding(java.nio.ByteOrder encoding)
          Set encoding of numeric data in the static buffer.
 void setSize(int size)
          Set total number of bytes of data currently in the static buffer.
 void setStaticBuffer(RawBuffer staticBuffer)
          Set representation of the static buffer.
 void strGather(boolean[] source, int srcOff, int rank, int exts, int strs, int[] shape)
          Append selected boolean elements from a multistrided region of array source to the current section of buffer.
 void strGather(byte[] source, int srcOff, int rank, int exts, int strs, int[] shape)
          Append selected byte elements from a multistrided region of array source to the current section of buffer.
 void strGather(char[] source, int srcOff, int rank, int exts, int strs, int[] shape)
          Append selected char elements from a multistrided region of array source to the current section of buffer.
 void strGather(double[] source, int srcOff, int rank, int exts, int strs, int[] shape)
          Append selected double elements from a multistrided region of array source to the current section of buffer.
 void strGather(float[] source, int srcOff, int rank, int exts, int strs, int[] shape)
          Append selected float elements from a multistrided region of array source to the current section of buffer.
 void strGather(int[] source, int srcOff, int rank, int exts, int strs, int[] shape)
          Append selected int elements from a multistrided region of array source to the current section of buffer.
 void strGather(long[] source, int srcOff, int rank, int exts, int strs, int[] shape)
          Append selected long elements from a multistrided region of array source to the current section of buffer.
 void strGather(java.lang.Object[] source, int srcOff, int rank, int exts, int strs, int[] shape)
          Append selected boolean elements from a multistrided region of array source to the current section of buffer.
 void strGather(short[] source, int srcOff, int rank, int exts, int strs, int[] shape)
          Append selected short elements from a multistrided region of array source to the current section of buffer.
 void strScatter(boolean[] dest, int dstOff, int rank, int exts, int strs, int[] shape)
          Read boolean items from the current section of the buffer, and write them to a multistrided region of the array dest.
 void strScatter(byte[] dest, int dstOff, int rank, int exts, int strs, int[] shape)
          Read byte items from the current section of the buffer, and write them to a multistrided region of the array dest.
 void strScatter(char[] dest, int dstOff, int rank, int exts, int strs, int[] shape)
          Read char items from the current section of the buffer, and write them to a multistrided region of the array dest.
 void strScatter(double[] dest, int dstOff, int rank, int exts, int strs, int[] shape)
          Read double items from the current section of the buffer, and write them to a multistrided region of the array dest.
 void strScatter(float[] dest, int dstOff, int rank, int exts, int strs, int[] shape)
          Read float items from the current section of the buffer, and write them to a multistrided region of the array dest.
 void strScatter(int[] dest, int dstOff, int rank, int exts, int strs, int[] shape)
          Read int items from the current section of the buffer, and write them to a multistrided region of the array dest.
 void strScatter(long[] dest, int dstOff, int rank, int exts, int strs, int[] shape)
          Read long items from the current section of the buffer, and write them to a multistrided region of the array dest.
 void strScatter(java.lang.Object[] dest, int dstOff, int rank, int exts, int strs, int[] shape)
          Read Object items from the current section of the buffer, and write them to a multistrided region of the array dest.
 void strScatter(short[] dest, int dstOff, int rank, int exts, int strs, int[] shape)
          Read short items from the current section of the buffer, and write them to a multistrided region of the array dest.
 void write(boolean[] source, int srcOff, int numEls)
          Append numEls consecutive boolean elements from array source, starting at index srcOff, to the current section of buffer.
 void write(byte[] source, int srcOff, int numEls)
          Append numEls consecutive byte elements from array source, starting at index srcOff, to the current section of buffer.
 void write(char[] source, int srcOff, int numEls)
          Append numEls consecutive char elements from array source, starting at index srcOff, to the current section of buffer.
 void write(double[] source, int srcOff, int numEls)
          Append numEls consecutive double elements from array source, starting at index srcOff, to the current section of buffer.
 void write(float[] source, int srcOff, int numEls)
          Append numEls consecutive float elements from array source, starting at index srcOff, to the current section of buffer.
 void write(int[] source, int srcOff, int numEls)
          Append numEls consecutive int elements from array source, starting at index srcOff, to the current section of buffer.
 void write(long[] source, int srcOff, int numEls)
          Append numEls consecutive long elements from array source, starting at index srcOff, to the current section of buffer.
 void write(java.lang.Object[] source, int srcOff, int numEls)
          Append numEls consecutive Object elements from array source, starting at index srcOff, to the current section of buffer.
 void write(short[] source, int srcOff, int numEls)
          Append numEls consecutive short elements from array source, starting at index srcOff, to the current section of buffer.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SECTION_OVERHEAD

public static final int SECTION_OVERHEAD
See Also:
Constant Field Values

ALIGNMENT_UNIT

public static final int ALIGNMENT_UNIT
See Also:
Constant Field Values
Constructor Detail

Buffer

protected Buffer()
Default constructor


Buffer

public Buffer(int capacity)
Creates a buffer with specified static capacity, and static buffer encoding given by java.nio.ByteOrder.nativeEncoding(). When created the buffer is empty, and it is in a writeable state.

Parameters:
capacity - the capacity of the static buffer, in bytes.

Buffer

public Buffer(RawBuffer buffer,
              int bufoffset,
              int capacity)
Creates a buffer with specified rawbuffer, and staring at the offset specified. Encoding given by java.nio.ByteOrder.nativeEncoding(). When created the buffer is not necessarily empty, but is in a writeable state. This constructor supports the Buffered mode of send at the higher level. buffer Rawbuffer offset the starting offset of this buffer need level argument ... public access required for bsend object is made in BasicType.java in 'createWriteBuffer' method.

Method Detail

offset

public int offset()

copy

public void copy(java.nio.ByteBuffer srcStaticBuffer,
                 int srcOffset,
                 int staticBufferLength,
                 int dstOffset,
                 byte[] srcDynamicBuffer,
                 int dynamicBufferLength)

free

public void free()
Free resources associated with this buffer. The only method invocations allowed on the buffer instance after this method has been called are further calls to free() or finalize(), none of which have any effect after the first invocation.


commit

public void commit()
            throws BufferException
Freeze buffer, putting it into a readable state, and setting the read pointer to the start of the buffer. This method can also be used to "rewind" a buffer that is already in readable state.

Throws:
DynamicBufferException - if there are unforseen problems saving the state of the dynamic buffer.
WrongStateException - if buffer has already been freed.
BufferException

clear

public void clear()
           throws BufferException
Empty the buffer and put it in a writeable state.

Throws:
WrongStateException - if buffer has already been freed.
BufferException

putSectionHeader

public void putSectionHeader(Type type)
                      throws BufferException
Start a new section in the buffer: write a section header to the buffer and make the new section the current section. The header requires SECTION_OVERHEAD bytes of static buffer capacity. Any preceding section will be padded with the minimum number of bytes necessary to ensure that the new section starts on a boundary that is a multiple of ALIGNMENT_UNIT bytes. This may require up to ALIGNMENT_UNIT - 1 bytes of additional buffer capacity.

Parameters:
type - the type of this section. One of BYTE, CHAR, SHORT, BOOLEAN, INT, LONG, FLOAT, or DOUBLE, if this is a static section, or one of OBJECT, BYTE_DYNAMIC, CHAR_DYNAMIC, SHORT_DYNAMIC, BOOLEAN_DYNAMIC, INT_DYNAMIC, LONG_DYNAMIC, FLOAT_DYNAMIC, or DOUBLE_DYNAMIC if this is a dynamic section.
Throws:
WrongStateException - if buffer is not in a writeable state, or buffer has already been freed.
BufferOverflowException - if there is insufficient space left in the static buffer.
BufferException

getSectionHeader

public Type getSectionHeader()
                      throws BufferException
Read a section header from the buffer, and make this the current section.

Returns:
the type of the expected section. One of BYTE, CHAR, SHORT, BOOLEAN, INT, LONG, FLOAT, DOUBLE, OBJECT, BYTE_DYNAMIC, CHAR_DYNAMIC, SHORT_DYNAMIC, BOOLEAN_DYNAMIC, INT_DYNAMIC, LONG_DYNAMIC, FLOAT_DYNAMIC, or DOUBLE_DYNAMIC.
Throws:
WrongStateException - if buffer is not in a readable state, or buffer has already been freed.
TypeMismatchException - if the value of the type parameter does not precisely match the value specified when the section was originally created by putSectionHeader().
SectionSizeMismatchException - if there are elements remaining to be read in the previous section.
BufferUnderflowException - if there there are no more sections remaining to be read in the buffer.
BufferException

getSectionSize

public int getSectionSize()
                   throws BufferException
Size of current section. If buffer is currently readable, return value is fixed for this section. If buffer is currently writable, return value is number of elements written to this section so far.

Returns:
number of elements in this section.
Throws:
WrongStateException - if current section is undefined, or buffer has already been freed.
BufferException

getRemaining

public int getRemaining()
                 throws BufferException
Returns number of elements remaining to be read in the current section.

Throws:
WrongStateException - if buffer is not in a readable state, or buffer has already been freed.
BufferException

write

public void write(byte[] source,
                  int srcOff,
                  int numEls)
           throws BufferException
Append numEls consecutive byte elements from array source, starting at index srcOff, to the current section of buffer. If the current section is a static section this requires 1 * numEls units of static buffer capacity.

Parameters:
source - the byte array from which data is taken.
srcOff - the subscript of the first element in the source array that is to be copied.
numEls - the total number of elements to be copied from source
Throws:
TypeMismatchException - if the current section was not created with type BYTE or BYTE_DYNAMIC.
BufferOverflowException - if there is insufficient space left in the static buffer.
WrongStateException - if buffer is not in a writeable state, or the current section is undefined, or the buffer has already been freed.
java.lang.ArrayIndexOutOfBoundsException - if the specified combination of srcOff and numEls would imply access to elements outside the bounds of source.
DynamicBufferException - if there are unforseen problems writing to the dynamic buffer.
BufferException

write

public void write(short[] source,
                  int srcOff,
                  int numEls)
           throws BufferException
Append numEls consecutive short elements from array source, starting at index srcOff, to the current section of buffer. If the current section is a static section this requires 2 * numEls units of static buffer capacity.

Parameters:
source - the short array from which data is taken.
srcOff - the subscript of the first element in the source array that is to be copied.
numEls - the total number of elements to be copied from source
Throws:
TypeMismatchException - if the current section was not created with type SHORT or SHORT_DYNAMIC.
BufferOverflowException - if there is insufficient space left in the static buffer.
WrongStateException - if buffer is not in a writeable state, or the current section is undefined, or the buffer has already been freed.
java.lang.ArrayIndexOutOfBoundsException - if the specified combination of srcOff and numEls would imply access to elements outside the bounds of source.
DynamicBufferException - if there are unforseen problems writing to the dynamic buffer.
BufferException

write

public void write(int[] source,
                  int srcOff,
                  int numEls)
           throws BufferException
Append numEls consecutive int elements from array source, starting at index srcOff, to the current section of buffer. If the current section is a static section this requires 4 * numEls units of static buffer capacity.

Parameters:
source - the int array from which data is taken.
srcOff - the subscript of the first element in the source array that is to be copied.
numEls - the total number of elements to be copied from source
Throws:
TypeMismatchException - if the current section was not created with type INT or INT_DYNAMIC.
BufferOverflowException - if there is insufficient space left in the static buffer.
WrongStateException - if buffer is not in a writeable state, or the current section is undefined, or the buffer has already been freed.
java.lang.ArrayIndexOutOfBoundsException - if the specified combination of srcOff and numEls would imply access to elements outside the bounds of source.
DynamicBufferException - if there are unforseen problems writing to the dynamic buffer.
BufferException

write

public void write(long[] source,
                  int srcOff,
                  int numEls)
           throws BufferException
Append numEls consecutive long elements from array source, starting at index srcOff, to the current section of buffer. If the current section is a static section this requires 8 * numEls units of static buffer capacity.

Parameters:
source - the long array from which data is taken.
srcOff - the subscript of the first element in the source array that is to be copied.
numEls - the total number of elements to be copied from source
Throws:
TypeMismatchException - if the current section was not created with type LONG or LONG_DYNAMIC.
BufferOverflowException - if there is insufficient space left in the static buffer.
WrongStateException - if buffer is not in a writeable state, or the current section is undefined, or the buffer has already been freed.
java.lang.ArrayIndexOutOfBoundsException - if the specified combination of srcOff and numEls would imply access to elements outside the bounds of source.
DynamicBufferException - if there are unforseen problems writing to the dynamic buffer.
BufferException

write

public void write(char[] source,
                  int srcOff,
                  int numEls)
           throws BufferException
Append numEls consecutive char elements from array source, starting at index srcOff, to the current section of buffer. If the current section is a static section this requires 2 * numEls units of static buffer capacity.

Parameters:
source - the char array from which data is taken.
srcOff - the subscript of the first element in the source array that is to be copied.
numEls - the total number of elements to be copied from source
Throws:
TypeMismatchException - if the current section was not created with type CHAR or CHAR_DYNAMIC.
BufferOverflowException - if there is insufficient space left in the static buffer.
WrongStateException - if buffer is not in a writeable state, or the current section is undefined, or the buffer has already been freed.
java.lang.ArrayIndexOutOfBoundsException - if the specified combination of srcOff and numEls would imply access to elements outside the bounds of source.
DynamicBufferException - if there are unforseen problems writing to the dynamic buffer.
BufferException

write

public void write(float[] source,
                  int srcOff,
                  int numEls)
           throws BufferException
Append numEls consecutive float elements from array source, starting at index srcOff, to the current section of buffer. If the current section is a static section this requires 4 * numEls units of static buffer capacity.

Parameters:
source - the float array from which data is taken.
srcOff - the subscript of the first element in the source array that is to be copied.
numEls - the total number of elements to be copied from source
Throws:
TypeMismatchException - if the current section was not created with type FLOAT or FLOAT_DYNAMIC.
BufferOverflowException - if there is insufficient space left in the static buffer.
WrongStateException - if buffer is not in a writeable state, or the current section is undefined, or the buffer has already been freed.
java.lang.ArrayIndexOutOfBoundsException - if the specified combination of srcOff and numEls would imply access to elements outside the bounds of source.
DynamicBufferException - if there are unforseen problems writing to the dynamic buffer.
BufferException

write

public void write(double[] source,
                  int srcOff,
                  int numEls)
           throws BufferException
Append numEls consecutive double elements from array source, starting at index srcOff, to the current section of buffer. If the current section is a static section this requires 8 * numEls units of static buffer capacity.

Parameters:
source - the double array from which data is taken.
srcOff - the subscript of the first element in the source array that is to be copied.
numEls - the total number of elements to be copied from source
Throws:
TypeMismatchException - if the current section was not created with type DOUBLE or DOUBLE_DYNAMIC.
BufferOverflowException - if there is insufficient space left in the static buffer.
WrongStateException - if buffer is not in a writeable state, or the current section is undefined, or the buffer has already been freed.
java.lang.ArrayIndexOutOfBoundsException - if the specified combination of srcOff and numEls would imply access to elements outside the bounds of source.
DynamicBufferException - if there are unforseen problems writing to the dynamic buffer.
BufferException

write

public void write(boolean[] source,
                  int srcOff,
                  int numEls)
           throws BufferException
Append numEls consecutive boolean elements from array source, starting at index srcOff, to the current section of buffer. If the current section is a static section this requires 1 * numEls units of static buffer capacity.

Parameters:
source - the boolean array from which data is taken.
srcOff - the subscript of the first element in the source array that is to be copied.
numEls - the total number of elements to be copied from source
Throws:
TypeMismatchException - if the current section was not created with type BOOLEAN or BOOLEAN_DYNAMIC.
BufferOverflowException - if there is insufficient space left in the static buffer.
WrongStateException - if buffer is not in a writeable state, or the current section is undefined, or the buffer has already been freed.
java.lang.ArrayIndexOutOfBoundsException - if the specified combination of srcOff and numEls would imply access to elements outside the bounds of source.
DynamicBufferException - if there are unforseen problems writing to the dynamic buffer.
BufferException

write

public void write(java.lang.Object[] source,
                  int srcOff,
                  int numEls)
           throws BufferException
Append numEls consecutive Object elements from array source, starting at index srcOff, to the current section of buffer.

Parameters:
source - the Object array from which data is taken.
srcOff - the subscript of the first element in the source array that is to be copied.
numEls - the total number of elements to be copied from source
Throws:
TypeMismatchException - if the current section was not created with type OBJECT.
WrongStateException - if buffer is not in a writeable state, or the current section is undefined, or the buffer has already been freed.
java.lang.ArrayIndexOutOfBoundsException - if the specified combination of srcOff and numEls would imply access to elements outside the bounds of source.
DynamicBufferException - if there are unforseen problems writing to the dynamic buffer.
BufferException

gather

public void gather(byte[] source,
                   int numEls,
                   int idxOff,
                   int[] indexes)
            throws BufferException
Append numEls selected byte elements from array source to the current section of buffer. The elements copied from source are selected by subscripts taken from numEls consecutive elements of the array indexes, starting at index idxOff in the latter array. See class description for further details. If the current section of the buffer is a static section this requires 1 * numEls units of static buffer capacity.

Parameters:
source - the byte array from which data is taken.
idxOff - the subscript of the first element in the array indexes to be used as an index into source.
numEls - the total number of elements to be copied from source
indexes - an int array containing subscripts into source.
Throws:
TypeMismatchException - if the current section was not created with type BYTE or BYTE_DYNAMIC.
BufferOverflowException - if there is insufficient space left in the static buffer.
WrongStateException - if buffer is not in a writeable state, or the current section is undefined, or the buffer has already been freed.
java.lang.ArrayIndexOutOfBoundsException - if the specified combination of idxOff and numEls would imply access to elements outside the bounds of indexes, or if a selected element of indexes requires access to an element outside the bounds of source.
DynamicBufferException - if there are unforseen problems writing to the dynamic buffer.
BufferException

gather

public void gather(short[] source,
                   int numEls,
                   int idxOff,
                   int[] indexes)
            throws BufferException
Append numEls selected short elements from array source to the current section of buffer. The elements copied from source are selected by subscripts taken from numEls consecutive elements of the array indexes, starting at index idxOff in the latter array. See class description for further details. If the current section of the buffer is a static section this requires 2 * numEls units of static buffer capacity.

Parameters:
source - the short array from which data is taken.
idxOff - the subscript of the first element in the array indexes to be used as an index into source.
numEls - the total number of elements to be copied from source
indexes - an int array containing subscripts into source.
Throws:
TypeMismatchException - if the current section was not created with type SHORT or SHORT_DYNAMIC.
BufferOverflowException - if there is insufficient space left in the static buffer.
WrongStateException - if buffer is not in a writeable state, or the current section is undefined, or the buffer has already been freed.
java.lang.ArrayIndexOutOfBoundsException - if the specified combination of idxOff and numEls would imply access to elements outside the bounds of indexes, or if a selected element of indexes requires access to an element outside the bounds of source.
DynamicBufferException - if there are unforseen problems writing to the dynamic buffer.
BufferException

gather

public void gather(int[] source,
                   int numEls,
                   int idxOff,
                   int[] indexes)
            throws BufferException
Append numEls selected int elements from array source to the current section of buffer. The elements copied from source are selected by subscripts taken from numEls consecutive elements of the array indexes, starting at index idxOff in the latter array. See class description for further details. If the current section of the buffer is a static section this requires 4 * numEls units of static buffer capacity.

Parameters:
source - the int array from which data is taken.
idxOff - the subscript of the first element in the array indexes to be used as an index into source.
numEls - the total number of elements to be copied from source
indexes - an int array containing subscripts into source.
Throws:
TypeMismatchException - if the current section was not created with type INT or INT_DYNAMIC.
BufferOverflowException - if there is insufficient space left in the static buffer.
WrongStateException - if buffer is not in a writeable state, or the current section is undefined, or the buffer has already been freed.
java.lang.ArrayIndexOutOfBoundsException - if the specified combination of idxOff and numEls would imply access to elements outside the bounds of indexes, or if a selected element of indexes requires access to an element outside the bounds of source.
DynamicBufferException - if there are unforseen problems writing to the dynamic buffer.
BufferException

gather

public void gather(long[] source,
                   int numEls,
                   int idxOff,
                   int[] indexes)
            throws BufferException
Append numEls selected long elements from array source to the current section of buffer. The elements copied from source are selected by subscripts taken from numEls consecutive elements of the array indexes, starting at index idxOff in the latter array. See class description for further details. If the current section of the buffer is a static section this requires 8 * numEls units of static buffer capacity.

Parameters:
source - the long array from which data is taken.
idxOff - the subscript of the first element in the array indexes to be used as an index into source.
numEls - the total number of elements to be copied from source
indexes - an int array containing subscripts into source.
Throws:
TypeMismatchException - if the current section was not created with type LONG or LONG_DYNAMIC.
BufferOverflowException - if there is insufficient space left in the static buffer.
WrongStateException - if buffer is not in a writeable state, or the current section is undefined, or the buffer has already been freed.
java.lang.ArrayIndexOutOfBoundsException - if the specified combination of idxOff and numEls would imply access to elements outside the bounds of indexes, or if a selected element of indexes requires access to an element outside the bounds of source.
DynamicBufferException - if there are unforseen problems writing to the dynamic buffer.
BufferException

gather

public void gather(char[] source,
                   int numEls,
                   int idxOff,
                   int[] indexes)
            throws BufferException
Append numEls selected char elements from array source to the current section of buffer. The elements copied from source are selected by subscripts taken from numEls consecutive elements of the array indexes, starting at index idxOff in the latter array. See class description for further details. If the current section of the buffer is a static section this requires 2 * numEls units of static buffer capacity.

Parameters:
source - the char array from which data is taken.
idxOff - the subscript of the first element in the array indexes to be used as an index into source.
numEls - the total number of elements to be copied from source
indexes - an int array containing subscripts into source.
Throws:
TypeMismatchException - if the current section was not created with type CHAR or CHAR_DYNAMIC.
BufferOverflowException - if there is insufficient space left in the static buffer.
WrongStateException - if buffer is not in a writeable state, or the current section is undefined, or the buffer has already been freed.
java.lang.ArrayIndexOutOfBoundsException - if the specified combination of idxOff and numEls would imply access to elements outside the bounds of indexes, or if a selected element of indexes requires access to an element outside the bounds of source.
DynamicBufferException - if there are unforseen problems writing to the dynamic buffer.
BufferException

gather

public void gather(float[] source,
                   int numEls,
                   int idxOff,
                   int[] indexes)
            throws BufferException
Append numEls selected float elements from array source to the current section of buffer. The elements copied from source are selected by subscripts taken from numEls consecutive elements of the array indexes, starting at index idxOff in the latter array. See class description for further details. If the current section of the buffer is a static section this requires 4 * numEls units of static buffer capacity.

Parameters:
source - the float array from which data is taken.
idxOff - the subscript of the first element in the array indexes to be used as an index into source.
numEls - the total number of elements to be copied from source
indexes - an int array containing subscripts into source.
Throws:
TypeMismatchException - if the current section was not created with type FLOAT or FLOAT_DYNAMIC.
BufferOverflowException - if there is insufficient space left in the static buffer.
WrongStateException - if buffer is not in a writeable state, or the current section is undefined, or the buffer has already been freed.
java.lang.ArrayIndexOutOfBoundsException - if the specified combination of idxOff and numEls would imply access to elements outside the bounds of indexes, or if a selected element of indexes requires access to an element outside the bounds of source.
DynamicBufferException - if there are unforseen problems writing to the dynamic buffer.
BufferException

gather

public void gather(double[] source,
                   int numEls,
                   int idxOff,
                   int[] indexes)
            throws BufferException
Append numEls selected double elements from array source to the current section of buffer. The elements copied from source are selected by subscripts taken from numEls consecutive elements of the array indexes, starting at index idxOff in the latter array. See class description for further details. If the current section of the buffer is a static section this requires 8 * numEls units of static buffer capacity.

Parameters:
source - the double array from which data is taken.
idxOff - the subscript of the first element in the array indexes to be used as an index into source.
numEls - the total number of elements to be copied from source
indexes - an int array containing subscripts into source.
Throws:
TypeMismatchException - if the current section was not created with type DOUBLE or DOUBLE_DYNAMIC.
BufferOverflowException - if there is insufficient space left in the static buffer.
WrongStateException - if buffer is not in a writeable state, or the current section is undefined, or the buffer has already been freed.
java.lang.ArrayIndexOutOfBoundsException - if the specified combination of idxOff and numEls would imply access to elements outside the bounds of indexes, or if a selected element of indexes requires access to an element outside the bounds of source.
DynamicBufferException - if there are unforseen problems writing to the dynamic buffer.
BufferException

gather

public void gather(boolean[] source,
                   int numEls,
                   int idxOff,
                   int[] indexes)
            throws BufferException
Append numEls selected boolean elements from array source to the current section of buffer. The elements copied from source are selected by subscripts taken from numEls consecutive elements of the array indexes, starting at index idxOff in the latter array. See class description for further details. If the current section of the buffer is a static section this requires 1 * numEls units of static buffer capacity.

Parameters:
source - the boolean array from which data is taken.
idxOff - the subscript of the first element in the array indexes to be used as an index into source.
numEls - the total number of elements to be copied from source
indexes - an int array containing subscripts into source.
Throws:
TypeMismatchException - if the current section was not created with type BOOLEAN or BOOLEAN_DYNAMIC.
BufferOverflowException - if there is insufficient space left in the static buffer.
WrongStateException - if buffer is not in a writeable state, or the current section is undefined, or the buffer has already been freed.
java.lang.ArrayIndexOutOfBoundsException - if the specified combination of idxOff and numEls would imply access to elements outside the bounds of indexes, or if a selected element of indexes requires access to an element outside the bounds of source.
DynamicBufferException - if there are unforseen problems writing to the dynamic buffer.
BufferException

gather

public void gather(java.lang.Object[] source,
                   int numEls,
                   int idxOff,
                   int[] indexes)
            throws BufferException
Append numEls selected Object elements from array source to the current section of buffer. The elements copied from source are selected by subscripts taken from numEls consecutive elements of the array indexes, starting at index idxOff in the latter array. See class description for further details.

Parameters:
source - the Object array from which data is taken.
numEls - the total number of elements to be copied from source
idxOff - the subscript of the first element in the array indexes to be used as an index into source.
indexes - an int array containing subscripts into source.
Throws:
TypeMismatchException - if the current section was not created with type OBJECT.
WrongStateException - if buffer is not in a writeable state, or the current section is undefined, or the buffer has already been freed.
java.lang.ArrayIndexOutOfBoundsException - if the specified combination of idxOff and numEls would imply access to elements outside the bounds of indexes, or if a selected element of indexes requires access to an element outside the bounds of source.
DynamicBufferException - if there are unforseen problems writing to the dynamic buffer.
BufferException

strGather

public void strGather(byte[] source,
                      int srcOff,
                      int rank,
                      int exts,
                      int strs,
                      int[] shape)
               throws BufferException
Append selected byte elements from a multistrided region of array source to the current section of buffer. See class description for details. If the current section of the buffer is a static section this requires 1 * volume units of static buffer capacity, where volume is the product of the extents of the specified region.

Parameters:
source - the byte array from which data is taken.
srcOff - the subscript of the first element in the source array that is to be copied.
rank - the rank or dimensionality of the region to be copied from source
exts - the offset in the shape array of the first of rank extents.
strs - the offset in the shape array of the first of rank strides.
shape - an int array holding extent and stride information for the region to be copied from source.
Throws:
TypeMismatchException - if the current section was not created with type BYTE or BYTE_DYNAMIC.
BufferOverflowException - if there is insufficient space left in the static buffer.
WrongStateException - if buffer is not in a writeable state, or the current section is undefined, or the buffer has already been freed.
IllegalArgumentException - if the specified rank is negative.
java.lang.ArrayIndexOutOfBoundsException - if the values of rank and exts and strs would imply access to elements outside the bounds of shape, or if the region defined by the resulting extents and strides would imply access to elements outside the bounds of source.
DynamicBufferException - if there are unforseen problems writing to the dynamic buffer.
BufferException

strGather

public void strGather(short[] source,
                      int srcOff,
                      int rank,
                      int exts,
                      int strs,
                      int[] shape)
               throws BufferException
Append selected short elements from a multistrided region of array source to the current section of buffer. See class description for details. If the current section of the buffer is a static section this requires 2 * volume units of static buffer capacity, where volume is the product of the extents of the specified region.

Parameters:
source - the short array from which data is taken.
srcOff - the subscript of the first element in the source array that is to be copied.
rank - the rank or dimensionality of the region to be copied from source
exts - the offset in the shape array of the first of rank extents.
strs - the offset in the shape array of the first of rank strides.
shape - an int array holding extent and stride information for the region to be copied from source.
Throws:
TypeMismatchException - if the current section was not created with type SHORT or SHORT_DYNAMIC.
BufferOverflowException - if there is insufficient space left in the static buffer.
WrongStateException - if buffer is not in a writeable state, or the current section is undefined, or the buffer has already been freed.
IllegalArgumentException - if the specified rank is negative.
java.lang.ArrayIndexOutOfBoundsException - if the values of rank and exts and strs would imply access to elements outside the bounds of shape, or if the region defined by the resulting extents and strides would imply access to elements outside the bounds of source.
DynamicBufferException - if there are unforseen problems writing to the dynamic buffer.
BufferException

strGather

public void strGather(int[] source,
                      int srcOff,
                      int rank,
                      int exts,
                      int strs,
                      int[] shape)
               throws BufferException
Append selected int elements from a multistrided region of array source to the current section of buffer. See class description for details. If the current section of the buffer is a static section this requires 4 * volume units of static buffer capacity, where volume is the product of the extents of the specified region.

Parameters:
source - the int array from which data is taken.
srcOff - the subscript of the first element in the source array that is to be copied.
rank - the rank or dimensionality of the region to be copied from source
exts - the offset in the shape array of the first of rank extents.
strs - the offset in the shape array of the first of rank strides.
shape - an int array holding extent and stride information for the region to be copied from source.
Throws:
TypeMismatchException - if the current section was not created with type INT or INT_DYNAMIC.
BufferOverflowException - if there is insufficient space left in the static buffer.
WrongStateException - if buffer is not in a writeable state, or the current section is undefined, or the buffer has already been freed.
IllegalArgumentException - if the specified rank is negative.
java.lang.ArrayIndexOutOfBoundsException - if the values of rank and exts and strs would imply access to elements outside the bounds of shape, or if the region defined by the resulting extents and strides would imply access to elements outside the bounds of source.
DynamicBufferException - if there are unforseen problems writing to the dynamic buffer.
BufferException

strGather

public void strGather(long[] source,
                      int srcOff,
                      int rank,
                      int exts,
                      int strs,
                      int[] shape)
               throws BufferException
Append selected long elements from a multistrided region of array source to the current section of buffer. See class description for details. If the current section of the buffer is a static section this requires 8 * volume units of static buffer capacity, where volume is the product of the extents of the specified region.

Parameters:
source - the long array from which data is taken.
srcOff - the subscript of the first element in the source array that is to be copied.
rank - the rank or dimensionality of the region to be copied from source
exts - the offset in the shape array of the first of rank extents.
strs - the offset in the shape array of the first of rank strides.
shape - an int array holding extent and stride information for the region to be copied from source.
Throws:
TypeMismatchException - if the current section was not created with type LONG or LONG_DYNAMIC.
BufferOverflowException - if there is insufficient space left in the static buffer.
WrongStateException - if buffer is not in a writeable state, or the current section is undefined, or the buffer has already been freed.
IllegalArgumentException - if the specified rank is negative.
java.lang.ArrayIndexOutOfBoundsException - if the values of rank and exts and strs would imply access to elements outside the bounds of shape, or if the region defined by the resulting extents and strides would imply access to elements outside the bounds of source.
DynamicBufferException - if there are unforseen problems writing to the dynamic buffer.
BufferException

strGather

public void strGather(char[] source,
                      int srcOff,
                      int rank,
                      int exts,
                      int strs,
                      int[] shape)
               throws BufferException
Append selected char elements from a multistrided region of array source to the current section of buffer. See class description for details. If the current section of the buffer is a static section this requires 2 * volume units of static buffer capacity, where volume is the product of the extents of the specified region.

Parameters:
source - the char array from which data is taken.
srcOff - the subscript of the first element in the source array that is to be copied.
rank - the rank or dimensionality of the region to be copied from source
exts - the offset in the shape array of the first of rank extents.
strs - the offset in the shape array of the first of rank strides.
shape - an int array holding extent and stride information for the region to be copied from source.
Throws:
TypeMismatchException - if the current section was not created with type CHAR or CHAR_DYNAMIC.
BufferOverflowException - if there is insufficient space left in the static buffer.
WrongStateException - if buffer is not in a writeable state, or the current section is undefined, or the buffer has already been freed.
IllegalArgumentException - if the specified rank is negative.
java.lang.ArrayIndexOutOfBoundsException - if the values of rank and exts and strs would imply access to elements outside the bounds of shape, or if the region defined by the resulting extents and strides would imply access to elements outside the bounds of source.
DynamicBufferException - if there are unforseen problems writing to the dynamic buffer.
BufferException

strGather

public void strGather(float[] source,
                      int srcOff,
                      int rank,
                      int exts,
                      int strs,
                      int[] shape)
               throws BufferException
Append selected float elements from a multistrided region of array source to the current section of buffer. See class description for details. If the current section of the buffer is a static section this requires 4 * volume units of static buffer capacity, where volume is the product of the extents of the specified region.

Parameters:
source - the float array from which data is taken.
srcOff - the subscript of the first element in the source array that is to be copied.
rank - the rank or dimensionality of the region to be copied from source
exts - the offset in the shape array of the first of rank extents.
strs - the offset in the shape array of the first of rank strides.
shape - an int array holding extent and stride information for the region to be copied from source.
Throws:
TypeMismatchException - if the current section was not created with type FLOAT or FLOAT_DYNAMIC.
BufferOverflowException - if there is insufficient space left in the static buffer.
WrongStateException - if buffer is not in a writeable state, or the current section is undefined, or the buffer has already been freed.
IllegalArgumentException - if the specified rank is negative.
java.lang.ArrayIndexOutOfBoundsException - if the values of rank and exts and strs would imply access to elements outside the bounds of shape, or if the region defined by the resulting extents and strides would imply access to elements outside the bounds of source.
DynamicBufferException - if there are unforseen problems writing to the dynamic buffer.
BufferException

strGather

public void strGather(double[] source,
                      int srcOff,
                      int rank,
                      int exts,
                      int strs,
                      int[] shape)
               throws BufferException
Append selected double elements from a multistrided region of array source to the current section of buffer. See class description for details. If the current section of the buffer is a static section this requires 8 * volume units of static buffer capacity, where volume is the product of the extents of the specified region.

Parameters:
source - the double array from which data is taken.
srcOff - the subscript of the first element in the source array that is to be copied.
rank - the rank or dimensionality of the region to be copied from source
exts - the offset in the shape array of the first of rank extents.
strs - the offset in the shape array of the first of rank strides.
shape - an int array holding extent and stride information for the region to be copied from source.
Throws:
TypeMismatchException - if the current section was not created with type DOUBLE or DOUBLE_DYNAMIC.
BufferOverflowException - if there is insufficient space left in the static buffer.
WrongStateException - if buffer is not in a writeable state, or the current section is undefined, or the buffer has already been freed.
IllegalArgumentException - if the specified rank is negative.
java.lang.ArrayIndexOutOfBoundsException - if the values of rank and exts and strs would imply access to elements outside the bounds of shape, or if the region defined by the resulting extents and strides would imply access to elements outside the bounds of source.
DynamicBufferException - if there are unforseen problems writing to the dynamic buffer.
BufferException

strGather

public void strGather(boolean[] source,
                      int srcOff,
                      int rank,
                      int exts,
                      int strs,
                      int[] shape)
               throws BufferException
Append selected boolean elements from a multistrided region of array source to the current section of buffer. See class description for details. If the current section of the buffer is a static section this requires 1 * volume units of static buffer capacity, where volume is the product of the extents of the specified region.

Parameters:
source - the boolean array from which data is taken.
srcOff - the subscript of the first element in the source array that is to be copied.
rank - the rank or dimensionality of the region to be copied from source
exts - the offset in the shape array of the first of rank extents.
strs - the offset in the shape array of the first of rank strides.
shape - an int array holding extent and stride information for the region to be copied from source.
Throws:
TypeMismatchException - if the current section was not created with type BOOLEAN or BOOLEAN_DYNAMIC.
BufferOverflowException - if there is insufficient space left in the static buffer.
WrongStateException - if buffer is not in a writeable state, or the current section is undefined, or the buffer has already been freed.
IllegalArgumentException - if the specified rank is negative.
java.lang.ArrayIndexOutOfBoundsException - if the values of rank and exts and strs would imply access to elements outside the bounds of shape, or if the region defined by the resulting extents and strides would imply access to elements outside the bounds of source.
DynamicBufferException - if there are unforseen problems writing to the dynamic buffer.
BufferException

strGather

public void strGather(java.lang.Object[] source,
                      int srcOff,
                      int rank,
                      int exts,
                      int strs,
                      int[] shape)
               throws BufferException
Append selected boolean elements from a multistrided region of array source to the current section of buffer. See class description for details.

Parameters:
source - the boolean array from which data is taken.
srcOff - the subscript of the first element in the source array that is to be copied.
rank - the rank or dimensionality of the region to be copied from source
exts - the offset in the shape array of the first of rank extents.
strs - the offset in the shape array of the first of rank strides.
shape - an int array holding extent and stride information for the region to be copied from source.
Throws:
TypeMismatchException - if the current section was not created with type OBJECT.
WrongStateException - if buffer is not in a writeable state, or the current section is undefined, or the buffer has already been freed.
IllegalArgumentException - if the specified rank is negative.
java.lang.ArrayIndexOutOfBoundsException - if the values of rank and exts and strs would imply access to elements outside the bounds of shape, or if the region defined by the resulting extents and strides would imply access to elements outside the bounds of source.
DynamicBufferException - if there are unforseen problems writing to the dynamic buffer.
BufferException

read

public void read(byte[] dest,
                 int dstOff,
                 int numEls)
          throws BufferException
Read the next numEls byte items from the current section of the buffer, and write them to consecutive elements of the array dest, starting at index dstOff.

Parameters:
dest - the byte array to which data will be written.
dstOff - the subscript of the first element in the dest array that will be overwritten.
numEls - the total number of items to be copied from the buffer to elements of dest.
Throws:
TypeMismatchException - if the current section was not created with type BYTE or BYTE_DYNAMIC.
SectionSizeMismatchException - if this operation would imply reading past the end of the current section.
WrongStateException - if buffer is not in a readable state, or the current section is undefined, or the buffer has already been freed.
java.lang.ArrayIndexOutOfBoundsException - if the specified combination of dstOff and numEls would imply access to elements outside the bounds of dest.
DynamicBufferException - if there are unforseen problems reading the dynamic buffer.
BufferException

read

public void read(short[] dest,
                 int dstOff,
                 int numEls)
          throws BufferException
Read the next numEls short items from the current section of the buffer, and write them to consecutive elements of the array dest, starting at index dstOff.

Parameters:
dest - the short array to which data will be written.
dstOff - the subscript of the first element in the dest array that will be overwritten.
numEls - the total number of items to be copied from the buffer to elements of dest.
Throws:
TypeMismatchException - if the current section was not created with type SHORT or SHORT_DYNAMIC.
SectionSizeMismatchException - if this operation would imply reading past the end of the current section.
WrongStateException - if buffer is not in a readable state, or the current section is undefined, or the buffer has already been freed.
java.lang.ArrayIndexOutOfBoundsException - if the specified combination of dstOff and numEls would imply access to elements outside the bounds of dest.
DynamicBufferException - if there are unforseen problems reading the dynamic buffer.
BufferException

read

public void read(int[] dest,
                 int dstOff,
                 int numEls)
          throws BufferException
Read the next numEls int items from the current section of the buffer, and write them to consecutive elements of the array dest, starting at index dstOff.

Parameters:
dest - the int array to which data will be written.
dstOff - the subscript of the first element in the dest array that will be overwritten.
numEls - the total number of items to be copied from the buffer to elements of dest.
Throws:
TypeMismatchException - if the current section was not created with type INT or INT_DYNAMIC.
SectionSizeMismatchException - if this operation would imply reading past the end of the current section.
WrongStateException - if buffer is not in a readable state, or the current section is undefined, or the buffer has already been freed.
java.lang.ArrayIndexOutOfBoundsException - if the specified combination of dstOff and numEls would imply access to elements outside the bounds of dest.
DynamicBufferException - if there are unforseen problems reading the dynamic buffer.
BufferException

read

public void read(long[] dest,
                 int dstOff,
                 int numEls)
          throws BufferException
Read the next numEls long items from the current section of the buffer, and write them to consecutive elements of the array dest, starting at index dstOff.

Parameters:
dest - the long array to which data will be written.
dstOff - the subscript of the first element in the dest array that will be overwritten.
numEls - the total number of items to be copied from the buffer to elements of dest.
Throws:
TypeMismatchException - if the current section was not created with type LONG or LONG_DYNAMIC.
SectionSizeMismatchException - if this operation would imply reading past the end of the current section.
WrongStateException - if buffer is not in a readable state, or the current section is undefined, or the buffer has already been freed.
java.lang.ArrayIndexOutOfBoundsException - if the specified combination of dstOff and numEls would imply access to elements outside the bounds of dest.
DynamicBufferException - if there are unforseen problems reading the dynamic buffer.
BufferException

read

public void read(char[] dest,
                 int dstOff,
                 int numEls)
          throws BufferException
Read the next numEls char items from the current section of the buffer, and write them to consecutive elements of the array dest, starting at index dstOff.

Parameters:
dest - the char array to which data will be written.
dstOff - the subscript of the first element in the dest array that will be overwritten.
numEls - the total number of items to be copied from the buffer to elements of dest.
Throws:
TypeMismatchException - if the current section was not created with type CHAR or CHAR_DYNAMIC.
SectionSizeMismatchException - if this operation would imply reading past the end of the current section.
WrongStateException - if buffer is not in a readable state, or the current section is undefined, or the buffer has already been freed.
java.lang.ArrayIndexOutOfBoundsException - if the specified combination of dstOff and numEls would imply access to elements outside the bounds of dest.
DynamicBufferException - if there are unforseen problems reading the dynamic buffer.
BufferException

read

public void read(float[] dest,
                 int dstOff,
                 int numEls)
          throws BufferException
Read the next numEls float items from the current section of the buffer, and write them to consecutive elements of the array dest, starting at index dstOff.

Parameters:
dest - the float array to which data will be written.
dstOff - the subscript of the first element in the dest array that will be overwritten.
numEls - the total number of items to be copied from the buffer to elements of dest.
Throws:
TypeMismatchException - if the current section was not created with type FLOAT or FLOAT_DYNAMIC.
SectionSizeMismatchException - if this operation would imply reading past the end of the current section.
WrongStateException - if buffer is not in a readable state, or the current section is undefined, or the buffer has already been freed.
java.lang.ArrayIndexOutOfBoundsException - if the specified combination of dstOff and numEls would imply access to elements outside the bounds of dest.
DynamicBufferException - if there are unforseen problems reading the dynamic buffer.
BufferException

read

public void read(double[] dest,
                 int dstOff,
                 int numEls)
          throws BufferException
Read the next numEls double items from the current section of the buffer, and write them to consecutive elements of the array dest, starting at index dstOff.

Parameters:
dest - the double array to which data will be written.
dstOff - the subscript of the first element in the dest array that will be overwritten.
numEls - the total number of items to be copied from the buffer to elements of dest.
Throws:
TypeMismatchException - if the current section was not created with type DOUBLE or DOUBLE_DYNAMIC.
SectionSizeMismatchException - if this operation would imply reading past the end of the current section.
WrongStateException - if buffer is not in a readable state, or the current section is undefined, or the buffer has already been freed.
java.lang.ArrayIndexOutOfBoundsException - if the specified combination of dstOff and numEls would imply access to elements outside the bounds of dest.
DynamicBufferException - if there are unforseen problems reading the dynamic buffer.
BufferException

read

public void read(boolean[] dest,
                 int dstOff,
                 int numEls)
          throws BufferException
Read the next numEls boolean items from the current section of the buffer, and write them to consecutive elements of the array dest, starting at index dstOff.

Parameters:
dest - the boolean array to which data will be written.
dstOff - the subscript of the first element in the dest array that will be overwritten.
numEls - the total number of items to be copied from the buffer to elements of dest.
Throws:
TypeMismatchException - if the current section was not created with type BOOLEAN or BOOLEAN_DYNAMIC.
SectionSizeMismatchException - if this operation would imply reading past the end of the current section.
WrongStateException - if buffer is not in a readable state, or the current section is undefined, or the buffer has already been freed.
java.lang.ArrayIndexOutOfBoundsException - if the specified combination of dstOff and numEls would imply access to elements outside the bounds of dest.
DynamicBufferException - if there are unforseen problems reading the dynamic buffer.
BufferException

read

public void read(java.lang.Object[] dest,
                 int dstOff,
                 int numEls)
          throws BufferException
Read the next numEls Object items from the current section of the buffer, and write them to consecutive elements of the array dest, starting at index dstOff.

Parameters:
dest - the Object array to which data will be written.
dstOff - the subscript of the first element in the dest array that will be overwritten.
numEls - the total number of items to be copied from the buffer to elements of dest.
Throws:
TypeMismatchException - if the current section was not created with type OBJECT.
SectionSizeMismatchException - if this operation would imply reading past the end of the current section.
WrongStateException - if buffer is not in a readable state, or the current section is undefined, or the buffer has already been freed.
java.lang.ArrayIndexOutOfBoundsException - if the specified combination of dstOff and numEls would imply access to elements outside the bounds of dest.
DynamicBufferException - if there are problems reading objects from the dynamic buffer.
BufferException

scatter

public void scatter(byte[] dest,
                    int numEls,
                    int idxOff,
                    int[] indexes)
             throws BufferException
Read the next numEls byte items from the current section of the buffer, and write them to selected elements of the array dest. The elements of dest to which data is copied are selected by subscripts taken from numEls consecutive elements of the array indexes, starting at index idxOff in the latter array. See class description for further details.

Parameters:
dest - the byte array to which data will be written.
numEls - the total number of items to be copied from the buffer to elements of dest.
idxOff - the subscript of the first element in the array indexes to be used as an index into source.
indexes - an int array containing subscripts into dest.
Throws:
TypeMismatchException - if the current section was not created with type BYTE or BYTE_DYNAMIC.
SectionSizeMismatchException - if this operation would imply reading past the end of the current section.
WrongStateException - if buffer is not in a readable state, or the current section is undefined, or the buffer has already been freed.
java.lang.ArrayIndexOutOfBoundsException - if the specified combination of idxOff and numEls would imply access to elements outside the bounds of indexes, or if a selected element of indexes requires access to an element outside the bounds of dest.
DynamicBufferException - if there are unforseen problems reading the dynamic buffer.
BufferException

scatter

public void scatter(short[] dest,
                    int numEls,
                    int idxOff,
                    int[] indexes)
             throws BufferException
Read the next numEls short items from the current section of the buffer, and write them to selected elements of the array dest. The elements of dest to which data is copied are selected by subscripts taken from numEls consecutive elements of the array indexes, starting at index idxOff in the latter array. See class description for further details.

Parameters:
dest - the short array to which data will be written.
numEls - the total number of items to be copied from the buffer to elements of dest.
idxOff - the subscript of the first element in the array indexes to be used as an index into source.
indexes - an int array containing subscripts into dest.
Throws:
TypeMismatchException - if the current section was not created with type SHORT or SHORT_DYNAMIC.
SectionSizeMismatchException - if this operation would imply reading past the end of the current section.
WrongStateException - if buffer is not in a readable state, or the current section is undefined, or the buffer has already been freed.
java.lang.ArrayIndexOutOfBoundsException - if the specified combination of idxOff and numEls would imply access to elements outside the bounds of indexes, or if a selected element of indexes requires access to an element outside the bounds of dest.
DynamicBufferException - if there are unforseen problems reading the dynamic buffer.
BufferException

scatter

public void scatter(int[] dest,
                    int numEls,
                    int idxOff,
                    int[] indexes)
             throws BufferException
Read the next numEls int items from the current section of the buffer, and write them to selected elements of the array dest. The elements of dest to which data is copied are selected by subscripts taken from numEls consecutive elements of the array indexes, starting at index idxOff in the latter array. See class description for further details.

Parameters:
dest - the int array to which data will be written.
numEls - the total number of items to be copied from the buffer to elements of dest.
idxOff - the subscript of the first element in the array indexes to be used as an index into source.
indexes - an int array containing subscripts into dest.
Throws:
TypeMismatchException - if the current section was not created with type INT or INT_DYNAMIC.
SectionSizeMismatchException - if this operation would imply reading past the end of the current section.
WrongStateException - if buffer is not in a readable state, or the current section is undefined, or the buffer has already been freed.
java.lang.ArrayIndexOutOfBoundsException - if the specified combination of idxOff and numEls would imply access to elements outside the bounds of indexes, or if a selected element of indexes requires access to an element outside the bounds of dest.
DynamicBufferException - if there are unforseen problems reading the dynamic buffer.
BufferException

scatter

public void scatter(long[] dest,
                    int numEls,
                    int idxOff,
                    int[] indexes)
             throws BufferException
Read the next numEls long items from the current section of the buffer, and write them to selected elements of the array dest. The elements of dest to which data is copied are selected by subscripts taken from numEls consecutive elements of the array indexes, starting at index idxOff in the latter array. See class description for further details.

Parameters:
dest - the long array to which data will be written.
numEls - the total number of items to be copied from the buffer to elements of dest.
idxOff - the subscript of the first element in the array indexes to be used as an index into source.
indexes - an int array containing subscripts into dest.
Throws:
TypeMismatchException - if the current section was not created with type LONG or LONG_DYNAMIC.
SectionSizeMismatchException - if this operation would imply reading past the end of the current section.
WrongStateException - if buffer is not in a readable state, or the current section is undefined, or the buffer has already been freed.
java.lang.ArrayIndexOutOfBoundsException - if the specified combination of idxOff and numEls would imply access to elements outside the bounds of indexes, or if a selected element of indexes requires access to an element outside the bounds of dest.
DynamicBufferException - if there are unforseen problems reading the dynamic buffer.
BufferException

scatter

public void scatter(char[] dest,
                    int numEls,
                    int idxOff,
                    int[] indexes)
             throws BufferException
Read the next numEls char items from the current section of the buffer, and write them to selected elements of the array dest. The elements of dest to which data is copied are selected by subscripts taken from numEls consecutive elements of the array indexes, starting at index idxOff in the latter array. See class description for further details.

Parameters:
dest - the char array to which data will be written.
numEls - the total number of items to be copied from the buffer to elements of dest.
idxOff - the subscript of the first element in the array indexes to be used as an index into source.
indexes - an int array containing subscripts into dest.
Throws:
TypeMismatchException - if the current section was not created with type CHAR or CHAR_DYNAMIC.
SectionSizeMismatchException - if this operation would imply reading past the end of the current section.
WrongStateException - if buffer is not in a readable state, or the current section is undefined, or the buffer has already been freed.
java.lang.ArrayIndexOutOfBoundsException - if the specified combination of idxOff and numEls would imply access to elements outside the bounds of indexes, or if a selected element of indexes requires access to an element outside the bounds of dest.
DynamicBufferException - if there are unforseen problems reading the dynamic buffer.
BufferException

scatter

public void scatter(float[] dest,
                    int numEls,
                    int idxOff,
                    int[] indexes)
             throws BufferException
Read the next numEls float items from the current section of the buffer, and write them to selected elements of the array dest. The elements of dest to which data is copied are selected by subscripts taken from numEls consecutive elements of the array indexes, starting at index idxOff in the latter array. See class description for further details.

Parameters:
dest - the float array to which data will be written.
numEls - the total number of items to be copied from the buffer to elements of dest.
idxOff - the subscript of the first element in the array indexes to be used as an index into source.
indexes - an int array containing subscripts into dest.
Throws:
TypeMismatchException - if the current section was not created with type FLOAT or FLOAT_DYNAMIC.
SectionSizeMismatchException - if this operation would imply reading past the end of the current section.
WrongStateException - if buffer is not in a readable state, or the current section is undefined, or the buffer has already been freed.
java.lang.ArrayIndexOutOfBoundsException - if the specified combination of idxOff and numEls would imply access to elements outside the bounds of indexes, or if a selected element of indexes requires access to an element outside the bounds of dest.
DynamicBufferException - if there are unforseen problems reading the dynamic buffer.
BufferException

scatter

public void scatter(double[] dest,
                    int numEls,
                    int idxOff,
                    int[] indexes)
             throws BufferException
Read the next numEls double items from the current section of the buffer, and write them to selected elements of the array dest. The elements of dest to which data is copied are selected by subscripts taken from numEls consecutive elements of the array indexes, starting at index idxOff in the latter array. See class description for further details.

Parameters:
dest - the double array to which data will be written.
numEls - the total number of items to be copied from the buffer to elements of dest.
idxOff - the subscript of the first element in the array indexes to be used as an index into source.
indexes - an int array containing subscripts into dest.
Throws:
TypeMismatchException - if the current section was not created with type DOUBLE or DOUBLE_DYNAMIC.
SectionSizeMismatchException - if this operation would imply reading past the end of the current section.
WrongStateException - if buffer is not in a readable state, or the current section is undefined, or the buffer has already been freed.
java.lang.ArrayIndexOutOfBoundsException - if the specified combination of idxOff and numEls would imply access to elements outside the bounds of indexes, or if a selected element of indexes requires access to an element outside the bounds of dest.
DynamicBufferException - if there are unforseen problems reading the dynamic buffer.
BufferException

scatter

public void scatter(boolean[] dest,
                    int numEls,
                    int idxOff,
                    int[] indexes)
             throws BufferException
Read the next numEls boolean items from the current section of the buffer, and write them to selected elements of the array dest. The elements of dest to which data is copied are selected by subscripts taken from numEls consecutive elements of the array indexes, starting at index idxOff in the latter array. See class description for further details.

Parameters:
dest - the boolean array to which data will be written.
numEls - the total number of items to be copied from the buffer to elements of dest.
idxOff - the subscript of the first element in the array indexes to be used as an index into source.
indexes - an int array containing subscripts into dest.
Throws:
TypeMismatchException - if the current section was not created with type BOOLEAN or BOOLEAN_DYNAMIC.
SectionSizeMismatchException - if this operation would imply reading past the end of the current section.
WrongStateException - if buffer is not in a readable state, or the current section is undefined, or the buffer has already been freed.
java.lang.ArrayIndexOutOfBoundsException - if the specified combination of idxOff and numEls would imply access to elements outside the bounds of indexes, or if a selected element of indexes requires access to an element outside the bounds of dest.
DynamicBufferException - if there are unforseen problems reading the dynamic buffer.
BufferException

scatter

public void scatter(java.lang.Object[] dest,
                    int numEls,
                    int idxOff,
                    int[] indexes)
             throws BufferException
Read the next numEls Object items from the current section of the buffer, and write them to selected elements of the array dest. The elements of dest to which data is copied are selected by subscripts taken from numEls consecutive elements of the array indexes, starting at index idxOff in the latter array. See class description for further details.

Parameters:
dest - the Object array to which data will be written.
numEls - the total number of items to be copied from the buffer to elements of dest.
idxOff - the subscript of the first element in the array indexes to be used as an index into source.
indexes - an int array containing subscripts into dest.
Throws:
TypeMismatchException - if the current section was not created with type OBJECT.
SectionSizeMismatchException - if this operation would imply reading past the end of the current section.
WrongStateException - if buffer is not in a readable state, or the current section is undefined, or the buffer has already been freed.
java.lang.ArrayIndexOutOfBoundsException - if the specified combination of idxOff and numEls would imply access to elements outside the bounds of indexes, or if a selected element of indexes requires access to an element outside the bounds of dest.
DynamicBufferException - if there are problems reading objects from the dynamic buffer.
BufferException

strScatter

public void strScatter(byte[] dest,
                       int dstOff,
                       int rank,
                       int exts,
                       int strs,
                       int[] shape)
                throws BufferException
Read byte items from the current section of the buffer, and write them to a multistrided region of the array dest. See class description for details.

Parameters:
dest - the byte array to which data will be written.
dstOff - the subscript of the first element in the dest array that will be overwritten.
rank - the rank or dimensionality of the region in dest to which data is to be copied.
exts - the offset in the shape array of the first of rank extents.
strs - the offset in the shape array of the first of rank strides.
shape - an int array holding extent and stride information for the region in dest to which data is to be copied.
Throws:
TypeMismatchException - if the current section was not created with type BYTE or BYTE_DYNAMIC.
SectionSizeMismatchException - if this operation would imply reading past the end of the current section.
WrongStateException - if buffer is not in a readable state, or the current section is undefined, or the buffer has already been freed.
IllegalArgumentException - if the specified rank is negative.
java.lang.ArrayIndexOutOfBoundsException - if the values of rank and exts and strs would imply access to elements outside the bounds of shape, or if the region defined by the resulting extents and strides would imply access to elements outside the bounds of dest.
DynamicBufferException - if there are unforseen problems reading the dynamic buffer.
BufferException

strScatter

public void strScatter(short[] dest,
                       int dstOff,
                       int rank,
                       int exts,
                       int strs,
                       int[] shape)
                throws BufferException
Read short items from the current section of the buffer, and write them to a multistrided region of the array dest. See class description for details.

Parameters:
dest - the short array to which data will be written.
dstOff - the subscript of the first element in the dest array that will be overwritten.
rank - the rank or dimensionality of the region in dest to which data is to be copied.
exts - the offset in the shape array of the first of rank extents.
strs - the offset in the shape array of the first of rank strides.
shape - an int array holding extent and stride information for the region in dest to which data is to be copied.
Throws:
TypeMismatchException - if the current section was not created with type SHORT or SHORT_DYNAMIC.
SectionSizeMismatchException - if this operation would imply reading past the end of the current section.
WrongStateException - if buffer is not in a readable state, or the current section is undefined, or the buffer has already been freed.
IllegalArgumentException - if the specified rank is negative.
java.lang.ArrayIndexOutOfBoundsException - if the values of rank and exts and strs would imply access to elements outside the bounds of shape, or if the region defined by the resulting extents and strides would imply access to elements outside the bounds of dest.
DynamicBufferException - if there are unforseen problems reading the dynamic buffer.
BufferException

strScatter

public void strScatter(int[] dest,
                       int dstOff,
                       int rank,
                       int exts,
                       int strs,
                       int[] shape)
                throws BufferException
Read int items from the current section of the buffer, and write them to a multistrided region of the array dest. See class description for details.

Parameters:
dest - the int array to which data will be written.
dstOff - the subscript of the first element in the dest array that will be overwritten.
rank - the rank or dimensionality of the region in dest to which data is to be copied.
exts - the offset in the shape array of the first of rank extents.
strs - the offset in the shape array of the first of rank strides.
shape - an int array holding extent and stride information for the region in dest to which data is to be copied.
Throws:
TypeMismatchException - if the current section was not created with type INT or INT_DYNAMIC.
SectionSizeMismatchException - if this operation would imply reading past the end of the current section.
WrongStateException - if buffer is not in a readable state, or the current section is undefined, or the buffer has already been freed.
IllegalArgumentException - if the specified rank is negative.
java.lang.ArrayIndexOutOfBoundsException - if the values of rank and exts and strs would imply access to elements outside the bounds of shape, or if the region defined by the resulting extents and strides would imply access to elements outside the bounds of dest.
DynamicBufferException - if there are unforseen problems reading the dynamic buffer.
BufferException

strScatter

public void strScatter(long[] dest,
                       int dstOff,
                       int rank,
                       int exts,
                       int strs,
                       int[] shape)
                throws BufferException
Read long items from the current section of the buffer, and write them to a multistrided region of the array dest. See class description for details.

Parameters:
dest - the long array to which data will be written.
dstOff - the subscript of the first element in the dest array that will be overwritten.
rank - the rank or dimensionality of the region in dest to which data is to be copied.
exts - the offset in the shape array of the first of rank extents.
strs - the offset in the shape array of the first of rank strides.
shape - an int array holding extent and stride information for the region in dest to which data is to be copied.
Throws:
TypeMismatchException - if the current section was not created with type LONG or LONG_DYNAMIC.
SectionSizeMismatchException - if this operation would imply reading past the end of the current section.
WrongStateException - if buffer is not in a readable state, or the current section is undefined, or the buffer has already been freed.
IllegalArgumentException - if the specified rank is negative.
java.lang.ArrayIndexOutOfBoundsException - if the values of rank and exts and strs would imply access to elements outside the bounds of shape, or if the region defined by the resulting extents and strides would imply access to elements outside the bounds of dest.
DynamicBufferException - if there are unforseen problems reading the dynamic buffer.
BufferException

strScatter

public void strScatter(char[] dest,
                       int dstOff,
                       int rank,
                       int exts,
                       int strs,
                       int[] shape)
                throws BufferException
Read char items from the current section of the buffer, and write them to a multistrided region of the array dest. See class description for details.

Parameters:
dest - the char array to which data will be written.
dstOff - the subscript of the first element in the dest array that will be overwritten.
rank - the rank or dimensionality of the region in dest to which data is to be copied.
exts - the offset in the shape array of the first of rank extents.
strs - the offset in the shape array of the first of rank strides.
shape - an int array holding extent and stride information for the region in dest to which data is to be copied.
Throws:
TypeMismatchException - if the current section was not created with type CHAR or CHAR_DYNAMIC.
SectionSizeMismatchException - if this operation would imply reading past the end of the current section.
WrongStateException - if buffer is not in a readable state, or the current section is undefined, or the buffer has already been freed.
IllegalArgumentException - if the specified rank is negative.
java.lang.ArrayIndexOutOfBoundsException - if the values of rank and exts and strs would imply access to elements outside the bounds of shape, or if the region defined by the resulting extents and strides would imply access to elements outside the bounds of dest.
DynamicBufferException - if there are unforseen problems reading the dynamic buffer.
BufferException

strScatter

public void strScatter(float[] dest,
                       int dstOff,
                       int rank,
                       int exts,
                       int strs,
                       int[] shape)
                throws BufferException
Read float items from the current section of the buffer, and write them to a multistrided region of the array dest. See class description for details.

Parameters:
dest - the float array to which data will be written.
dstOff - the subscript of the first element in the dest array that will be overwritten.
rank - the rank or dimensionality of the region in dest to which data is to be copied.
exts - the offset in the shape array of the first of rank extents.
strs - the offset in the shape array of the first of rank strides.
shape - an int array holding extent and stride information for the region in dest to which data is to be copied.
Throws:
TypeMismatchException - if the current section was not created with type FLOAT or FLOAT_DYNAMIC.
SectionSizeMismatchException - if this operation would imply reading past the end of the current section.
WrongStateException - if buffer is not in a readable state, or the current section is undefined, or the buffer has already been freed.
IllegalArgumentException - if the specified rank is negative.
java.lang.ArrayIndexOutOfBoundsException - if the values of rank and exts and strs would imply access to elements outside the bounds of shape, or if the region defined by the resulting extents and strides would imply access to elements outside the bounds of dest.
DynamicBufferException - if there are unforseen problems reading the dynamic buffer.
BufferException

strScatter

public void strScatter(double[] dest,
                       int dstOff,
                       int rank,
                       int exts,
                       int strs,
                       int[] shape)
                throws BufferException
Read double items from the current section of the buffer, and write them to a multistrided region of the array dest. See class description for details.

Parameters:
dest - the double array to which data will be written.
dstOff - the subscript of the first element in the dest array that will be overwritten.
rank - the rank or dimensionality of the region in dest to which data is to be copied.
exts - the offset in the shape array of the first of rank extents.
strs - the offset in the shape array of the first of rank strides.
shape - an int array holding extent and stride information for the region in dest to which data is to be copied.
Throws:
TypeMismatchException - if the current section was not created with type DOUBLE or DOUBLE_DYNAMIC.
SectionSizeMismatchException - if this operation would imply reading past the end of the current section.
WrongStateException - if buffer is not in a readable state, or the current section is undefined, or the buffer has already been freed.
IllegalArgumentException - if the specified rank is negative.
java.lang.ArrayIndexOutOfBoundsException - if the values of rank and exts and strs would imply access to elements outside the bounds of shape, or if the region defined by the resulting extents and strides would imply access to elements outside the bounds of dest.
DynamicBufferException - if there are unforseen problems reading the dynamic buffer.
BufferException

strScatter

public void strScatter(boolean[] dest,
                       int dstOff,
                       int rank,
                       int exts,
                       int strs,
                       int[] shape)
                throws BufferException
Read boolean items from the current section of the buffer, and write them to a multistrided region of the array dest. See class description for details.

Parameters:
dest - the boolean array to which data will be written.
dstOff - the subscript of the first element in the dest array that will be overwritten.
rank - the rank or dimensionality of the region in dest to which data is to be copied.
exts - the offset in the shape array of the first of rank extents.
strs - the offset in the shape array of the first of rank strides.
shape - an int array holding extent and stride information for the region in dest to which data is to be copied.
Throws:
TypeMismatchException - if the current section was not created with type BOOLEAN or BOOLEAN_DYNAMIC.
SectionSizeMismatchException - if this operation would imply reading past the end of the current section.
WrongStateException - if buffer is not in a readable state, or the current section is undefined, or the buffer has already been freed.
IllegalArgumentException - if the specified rank is negative.
java.lang.ArrayIndexOutOfBoundsException - if the values of rank and exts and strs would imply access to elements outside the bounds of shape, or if the region defined by the resulting extents and strides would imply access to elements outside the bounds of dest.
DynamicBufferException - if there are unforseen problems reading the dynamic buffer.
BufferException

strScatter

public void strScatter(java.lang.Object[] dest,
                       int dstOff,
                       int rank,
                       int exts,
                       int strs,
                       int[] shape)
                throws BufferException
Read Object items from the current section of the buffer, and write them to a multistrided region of the array dest. See class description for details.

Parameters:
dest - the Object array to which data will be written.
dstOff - the subscript of the first element in the dest array that will be overwritten.
rank - the rank or dimensionality of the region in dest to which data is to be copied.
exts - the offset in the shape array of the first of rank extents.
strs - the offset in the shape array of the first of rank strides.
shape - an int array holding extent and stride information for the region in dest to which data is to be copied.
Throws:
TypeMismatchException - if the current section was not created with type OBJECT.
SectionSizeMismatchException - if this operation would imply reading past the end of the current section.
WrongStateException - if buffer is not in a readable state, or the current section is undefined, or the buffer has already been freed.
IllegalArgumentException - if the specified rank is negative.
java.lang.ArrayIndexOutOfBoundsException - if the values of rank and exts and strs would imply access to elements outside the bounds of shape, or if the region defined by the resulting extents and strides would imply access to elements outside the bounds of dest.
DynamicBufferException - if there are problems reading objects from the dynamic buffer.
BufferException

getStaticBuffer

public RawBuffer getStaticBuffer()
Returns a representation of the static buffer. Low-level method used for sending and receiving the buffer.


setStaticBuffer

public void setStaticBuffer(RawBuffer staticBuffer)
Set representation of the static buffer. Low-level method used for sending and receiving the buffer.


getEncoding

public java.nio.ByteOrder getEncoding()
Returns encoding of numeric data in the static buffer. Low-level method used for sending and receiving the buffer.


setEncoding

public void setEncoding(java.nio.ByteOrder encoding)
Set encoding of numeric data in the static buffer. Low-level method used for sending and receiving the buffer.


getSize

public int getSize()
Get total number of bytes of data currently in the static buffer. Low-level method used for sending and receiving the buffer.


setSize

public void setSize(int size)
Set total number of bytes of data currently in the static buffer. Low-level method used for sending and receiving the buffer.


getDynamicBuffer

public byte[] getDynamicBuffer()
Get bytes of the dynamic buffer. Low-level method used for sending and receiving the buffer. Only use this on a commited (readable) buffer.


setDynamicBuffer

public void setDynamicBuffer(byte[] dynamicBuffer)
Set bytes of the dynamic buffer. Low-level method used for sending and receiving the buffer. Buffer should be empty prior to this call.


isWritable

public boolean isWritable()
Determine read-write mode of buffer. Low-level method used for sending and receiving the buffer.