java.awt.image
Class DataBufferByte

java.lang.Object sample code for java.lang.Object definition code for java.lang.Object 
  extended by java.awt.image.DataBuffer sample code for java.awt.image.DataBuffer definition code for java.awt.image.DataBuffer 
      extended by java.awt.image.DataBufferByte

public final class DataBufferByte
extends DataBuffer sample code for java.awt.image.DataBuffer definition code for java.awt.image.DataBuffer

This class extends DataBuffer and stores data internally as bytes. Values stored in the byte array(s) of this DataBuffer are treated as unsigned values.


Field Summary
 
Fields inherited from class java.awt.image.DataBuffer sample code for java.awt.image.DataBuffer definition code for java.awt.image.DataBuffer
banks sample code for java.awt.image.DataBuffer.banks definition code for java.awt.image.DataBuffer.banks , dataType sample code for java.awt.image.DataBuffer.dataType definition code for java.awt.image.DataBuffer.dataType , offset sample code for java.awt.image.DataBuffer.offset definition code for java.awt.image.DataBuffer.offset , offsets sample code for java.awt.image.DataBuffer.offsets definition code for java.awt.image.DataBuffer.offsets , size sample code for java.awt.image.DataBuffer.size definition code for java.awt.image.DataBuffer.size , TYPE_BYTE sample code for java.awt.image.DataBuffer.TYPE_BYTE definition code for java.awt.image.DataBuffer.TYPE_BYTE , TYPE_DOUBLE sample code for java.awt.image.DataBuffer.TYPE_DOUBLE definition code for java.awt.image.DataBuffer.TYPE_DOUBLE , TYPE_FLOAT sample code for java.awt.image.DataBuffer.TYPE_FLOAT definition code for java.awt.image.DataBuffer.TYPE_FLOAT , TYPE_INT sample code for java.awt.image.DataBuffer.TYPE_INT definition code for java.awt.image.DataBuffer.TYPE_INT , TYPE_SHORT sample code for java.awt.image.DataBuffer.TYPE_SHORT definition code for java.awt.image.DataBuffer.TYPE_SHORT , TYPE_UNDEFINED sample code for java.awt.image.DataBuffer.TYPE_UNDEFINED definition code for java.awt.image.DataBuffer.TYPE_UNDEFINED , TYPE_USHORT sample code for java.awt.image.DataBuffer.TYPE_USHORT definition code for java.awt.image.DataBuffer.TYPE_USHORT
 
Constructor Summary
DataBufferByte sample code for java.awt.image.DataBufferByte.DataBufferByte(byte[][], int) definition code for java.awt.image.DataBufferByte.DataBufferByte(byte[][], int) (byte[][] dataArray, int size)
          Constructs a byte-based DataBuffer with the specified arrays.
DataBufferByte sample code for java.awt.image.DataBufferByte.DataBufferByte(byte[][], int, int[]) definition code for java.awt.image.DataBufferByte.DataBufferByte(byte[][], int, int[]) (byte[][] dataArray, int size, int[] offsets)
          Constructs a byte-based DataBuffer with the specified arrays, size, and offsets.
DataBufferByte sample code for java.awt.image.DataBufferByte.DataBufferByte(byte[], int) definition code for java.awt.image.DataBufferByte.DataBufferByte(byte[], int) (byte[] dataArray, int size)
          Constructs a byte-based DataBuffer with a single bank using the specified array.
DataBufferByte sample code for java.awt.image.DataBufferByte.DataBufferByte(byte[], int, int) definition code for java.awt.image.DataBufferByte.DataBufferByte(byte[], int, int) (byte[] dataArray, int size, int offset)
          Constructs a byte-based DataBuffer with a single bank using the specified array, size, and offset.
DataBufferByte sample code for java.awt.image.DataBufferByte.DataBufferByte(int) definition code for java.awt.image.DataBufferByte.DataBufferByte(int) (int size)
          Constructs a byte-based DataBuffer with a single bank and the specified size.
DataBufferByte sample code for java.awt.image.DataBufferByte.DataBufferByte(int, int) definition code for java.awt.image.DataBufferByte.DataBufferByte(int, int) (int size, int numBanks)
          Constructs a byte based DataBuffer with the specified number of banks all of which are the specified size.
 
Method Summary
 byte[][] getBankData sample code for java.awt.image.DataBufferByte.getBankData() definition code for java.awt.image.DataBufferByte.getBankData() ()
          Returns the data arrays for all banks.
 byte[] getData sample code for java.awt.image.DataBufferByte.getData() definition code for java.awt.image.DataBufferByte.getData() ()
          Returns the default (first) byte data array.
 byte[] getData sample code for java.awt.image.DataBufferByte.getData(int) definition code for java.awt.image.DataBufferByte.getData(int) (int bank)
          Returns the data array for the specified bank.
 int getElem sample code for java.awt.image.DataBufferByte.getElem(int) definition code for java.awt.image.DataBufferByte.getElem(int) (int i)
          Returns the requested data array element from the first (default) bank.
 int getElem sample code for java.awt.image.DataBufferByte.getElem(int, int) definition code for java.awt.image.DataBufferByte.getElem(int, int) (int bank, int i)
          Returns the requested data array element from the specified bank.
 void setElem sample code for java.awt.image.DataBufferByte.setElem(int, int) definition code for java.awt.image.DataBufferByte.setElem(int, int) (int i, int val)
          Sets the requested data array element in the first (default) bank to the specified value.
 void setElem sample code for java.awt.image.DataBufferByte.setElem(int, int, int) definition code for java.awt.image.DataBufferByte.setElem(int, int, int) (int bank, int i, int val)
          Sets the requested data array element in the specified bank from the given integer.
 
Methods inherited from class java.awt.image.DataBuffer sample code for java.awt.image.DataBuffer definition code for java.awt.image.DataBuffer
getDataType sample code for java.awt.image.DataBuffer.getDataType() definition code for java.awt.image.DataBuffer.getDataType() , getDataTypeSize sample code for java.awt.image.DataBuffer.getDataTypeSize(int) definition code for java.awt.image.DataBuffer.getDataTypeSize(int) , getElemDouble sample code for java.awt.image.DataBuffer.getElemDouble(int) definition code for java.awt.image.DataBuffer.getElemDouble(int) , getElemDouble sample code for java.awt.image.DataBuffer.getElemDouble(int, int) definition code for java.awt.image.DataBuffer.getElemDouble(int, int) , getElemFloat sample code for java.awt.image.DataBuffer.getElemFloat(int) definition code for java.awt.image.DataBuffer.getElemFloat(int) , getElemFloat sample code for java.awt.image.DataBuffer.getElemFloat(int, int) definition code for java.awt.image.DataBuffer.getElemFloat(int, int) , getNumBanks sample code for java.awt.image.DataBuffer.getNumBanks() definition code for java.awt.image.DataBuffer.getNumBanks() , getOffset sample code for java.awt.image.DataBuffer.getOffset() definition code for java.awt.image.DataBuffer.getOffset() , getOffsets sample code for java.awt.image.DataBuffer.getOffsets() definition code for java.awt.image.DataBuffer.getOffsets() , getSize sample code for java.awt.image.DataBuffer.getSize() definition code for java.awt.image.DataBuffer.getSize() , setElemDouble sample code for java.awt.image.DataBuffer.setElemDouble(int, double) definition code for java.awt.image.DataBuffer.setElemDouble(int, double) , setElemDouble sample code for java.awt.image.DataBuffer.setElemDouble(int, int, double) definition code for java.awt.image.DataBuffer.setElemDouble(int, int, double) , setElemFloat sample code for java.awt.image.DataBuffer.setElemFloat(int, float) definition code for java.awt.image.DataBuffer.setElemFloat(int, float) , setElemFloat sample code for java.awt.image.DataBuffer.setElemFloat(int, int, float) definition code for java.awt.image.DataBuffer.setElemFloat(int, int, float)
 
Methods inherited from class java.lang.Object sample code for java.lang.Object definition code for java.lang.Object
clone sample code for java.lang.Object.clone() definition code for java.lang.Object.clone() , equals sample code for java.lang.Object.equals(java.lang.Object) definition code for java.lang.Object.equals(java.lang.Object) , finalize sample code for java.lang.Object.finalize() definition code for java.lang.Object.finalize() , getClass sample code for java.lang.Object.getClass() definition code for java.lang.Object.getClass() , hashCode sample code for java.lang.Object.hashCode() definition code for java.lang.Object.hashCode() , notify sample code for java.lang.Object.notify() definition code for java.lang.Object.notify() , notifyAll sample code for java.lang.Object.notifyAll() definition code for java.lang.Object.notifyAll() , toString sample code for java.lang.Object.toString() definition code for java.lang.Object.toString() , wait sample code for java.lang.Object.wait() definition code for java.lang.Object.wait() , wait sample code for java.lang.Object.wait(long) definition code for java.lang.Object.wait(long) , wait sample code for java.lang.Object.wait(long, int) definition code for java.lang.Object.wait(long, int)
 

Constructor Detail

DataBufferByte sample code for java.awt.image.DataBufferByte(int) definition code for java.awt.image.DataBufferByte(int)

public DataBufferByte(int size)
Constructs a byte-based DataBuffer with a single bank and the specified size.

Parameters:
size - The size of the DataBuffer.

DataBufferByte sample code for java.awt.image.DataBufferByte(int, int) definition code for java.awt.image.DataBufferByte(int, int)

public DataBufferByte(int size,
                      int numBanks)
Constructs a byte based DataBuffer with the specified number of banks all of which are the specified size.

Parameters:
size - The size of the banks in the DataBuffer.
numBanks - The number of banks in the aDataBuffer.

DataBufferByte sample code for java.awt.image.DataBufferByte(byte[], int) definition code for java.awt.image.DataBufferByte(byte[], int)

public DataBufferByte(byte[] dataArray,
                      int size)
Constructs a byte-based DataBuffer with a single bank using the specified array. Only the first size elements should be used by accessors of this DataBuffer. dataArray must be large enough to hold size elements.

Parameters:
dataArray - The byte array for the DataBuffer.
size - The size of the DataBuffer bank.

DataBufferByte sample code for java.awt.image.DataBufferByte(byte[], int, int) definition code for java.awt.image.DataBufferByte(byte[], int, int)

public DataBufferByte(byte[] dataArray,
                      int size,
                      int offset)
Constructs a byte-based DataBuffer with a single bank using the specified array, size, and offset. dataArray must have at least offset + size elements. Only elements offset through offset + size - 1 should be used by accessors of this DataBuffer.

Parameters:
dataArray - The byte array for the DataBuffer.
size - The size of the DataBuffer bank.
offset - The offset into the dataArray. dataArray must have at least offset + size elements.

DataBufferByte sample code for java.awt.image.DataBufferByte(byte[][], int) definition code for java.awt.image.DataBufferByte(byte[][], int)

public DataBufferByte(byte[][] dataArray,
                      int size)
Constructs a byte-based DataBuffer with the specified arrays. The number of banks is equal to dataArray.length. Only the first size elements of each array should be used by accessors of this DataBuffer.

Parameters:
dataArray - The byte arrays for the DataBuffer.
size - The size of the banks in the DataBuffer.

DataBufferByte sample code for java.awt.image.DataBufferByte(byte[][], int, int[]) definition code for java.awt.image.DataBufferByte(byte[][], int, int[])

public DataBufferByte(byte[][] dataArray,
                      int size,
                      int[] offsets)
Constructs a byte-based DataBuffer with the specified arrays, size, and offsets. The number of banks is equal to dataArray.length. Each array must be at least as large as size + the corresponding offset. There must be an entry in the offset array for each dataArray entry. For each bank, only elements offset through offset + size - 1 should be used by accessors of this DataBuffer.

Parameters:
dataArray - The byte arrays for the DataBuffer.
size - The size of the banks in the DataBuffer.
offsets - The offsets into each array.
Method Detail

getData sample code for java.awt.image.DataBufferByte.getData() definition code for java.awt.image.DataBufferByte.getData()

public byte[] getData()
Returns the default (first) byte data array.

Returns:
The first byte data array.

getData sample code for java.awt.image.DataBufferByte.getData(int) definition code for java.awt.image.DataBufferByte.getData(int)

public byte[] getData(int bank)
Returns the data array for the specified bank.

Parameters:
bank - The bank whose data array you want to get.
Returns:
The data array for the specified bank.

getBankData sample code for java.awt.image.DataBufferByte.getBankData() definition code for java.awt.image.DataBufferByte.getBankData()

public byte[][] getBankData()
Returns the data arrays for all banks.

Returns:
All of the data arrays.

getElem sample code for java.awt.image.DataBufferByte.getElem(int) definition code for java.awt.image.DataBufferByte.getElem(int)

public int getElem(int i)
Returns the requested data array element from the first (default) bank.

Overrides:
getElem sample code for java.awt.image.DataBuffer.getElem(int) definition code for java.awt.image.DataBuffer.getElem(int) in class DataBuffer sample code for java.awt.image.DataBuffer definition code for java.awt.image.DataBuffer
Parameters:
i - The data array element you want to get.
Returns:
The requested data array element as an integer.
See Also:
setElem(int, int) sample code for java.awt.image.DataBufferByte.setElem(int, int) definition code for java.awt.image.DataBufferByte.setElem(int, int) , setElem(int, int, int) sample code for java.awt.image.DataBufferByte.setElem(int, int, int) definition code for java.awt.image.DataBufferByte.setElem(int, int, int)

getElem sample code for java.awt.image.DataBufferByte.getElem(int, int) definition code for java.awt.image.DataBufferByte.getElem(int, int)

public int getElem(int bank,
                   int i)
Returns the requested data array element from the specified bank.

Specified by:
getElem sample code for java.awt.image.DataBuffer.getElem(int, int) definition code for java.awt.image.DataBuffer.getElem(int, int) in class DataBuffer sample code for java.awt.image.DataBuffer definition code for java.awt.image.DataBuffer
Parameters:
bank - The bank from which you want to get a data array element.
i - The data array element you want to get.
Returns:
The requested data array element as an integer.
See Also:
setElem(int, int) sample code for java.awt.image.DataBufferByte.setElem(int, int) definition code for java.awt.image.DataBufferByte.setElem(int, int) , setElem(int, int, int) sample code for java.awt.image.DataBufferByte.setElem(int, int, int) definition code for java.awt.image.DataBufferByte.setElem(int, int, int)

setElem sample code for java.awt.image.DataBufferByte.setElem(int, int) definition code for java.awt.image.DataBufferByte.setElem(int, int)

public void setElem(int i,
                    int val)
Sets the requested data array element in the first (default) bank to the specified value.

Overrides:
setElem sample code for java.awt.image.DataBuffer.setElem(int, int) definition code for java.awt.image.DataBuffer.setElem(int, int) in class DataBuffer sample code for java.awt.image.DataBuffer definition code for java.awt.image.DataBuffer
Parameters:
i - The data array element you want to set.
val - The integer value to which you want to set the data array element.
See Also:
getElem(int) sample code for java.awt.image.DataBufferByte.getElem(int) definition code for java.awt.image.DataBufferByte.getElem(int) , getElem(int, int) sample code for java.awt.image.DataBufferByte.getElem(int, int) definition code for java.awt.image.DataBufferByte.getElem(int, int)

setElem sample code for java.awt.image.DataBufferByte.setElem(int, int, int) definition code for java.awt.image.DataBufferByte.setElem(int, int, int)

public void setElem(int bank,
                    int i,
                    int val)
Sets the requested data array element in the specified bank from the given integer.

Specified by:
setElem sample code for java.awt.image.DataBuffer.setElem(int, int, int) definition code for java.awt.image.DataBuffer.setElem(int, int, int) in class DataBuffer sample code for java.awt.image.DataBuffer definition code for java.awt.image.DataBuffer
Parameters:
bank - The bank in which you want to set the data array element.
i - The data array element you want to set.
val - The integer value to which you want to set the specified data array element.
See Also:
getElem(int) sample code for java.awt.image.DataBufferByte.getElem(int) definition code for java.awt.image.DataBufferByte.getElem(int) , getElem(int, int) sample code for java.awt.image.DataBufferByte.getElem(int, int) definition code for java.awt.image.DataBufferByte.getElem(int, int)