Home » openjdk-7 » java » awt » image » [javadoc | source]
java.awt.image
public final class: DataBufferByte [javadoc | source]
java.lang.Object
   java.awt.image.DataBuffer
      java.awt.image.DataBufferByte
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.

Note that some implementations may function more efficiently if they can maintain control over how the data for an image is stored. For example, optimizations such as caching an image in video memory require that the implementation track all modifications to that data. Other implementations may operate better if they can store the data in locations other than a Java array. To maintain optimum compatibility with various optimizations it is best to avoid constructors and methods which expose the underlying storage as a Java array, as noted below in the documentation for those methods.
Field Summary
 byte[] data    The default data bank. 
 byte[][] bankdata    All data banks 
Fields inherited from java.awt.image.DataBuffer:
TYPE_BYTE,  TYPE_USHORT,  TYPE_SHORT,  TYPE_INT,  TYPE_FLOAT,  TYPE_DOUBLE,  TYPE_UNDEFINED,  dataType,  banks,  offset,  size,  offsets,  theTrackable
Constructor:
 public DataBufferByte(int size) 
 public DataBufferByte(int size,
    int numBanks) 
 public DataBufferByte(byte[] dataArray,
    int size) 
    Parameters:
    dataArray - The byte array for the DataBuffer.
    size - The size of the DataBuffer bank.
 public DataBufferByte(byte[][] dataArray,
    int size) 
    Parameters:
    dataArray - The byte arrays for the DataBuffer.
    size - The size of the banks in the DataBuffer.
 public DataBufferByte(byte[] dataArray,
    int size,
    int offset) 
    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.
 public DataBufferByte(byte[][] dataArray,
    int size,
    int[] offsets) 
    Parameters:
    dataArray - The byte arrays for the DataBuffer.
    size - The size of the banks in the DataBuffer.
    offsets - The offsets into each array.
Method from java.awt.image.DataBufferByte Summary:
getBankData,   getData,   getData,   getElem,   getElem,   setElem,   setElem
Methods from java.awt.image.DataBuffer:
getDataType,   getDataTypeSize,   getElem,   getElem,   getElemDouble,   getElemDouble,   getElemFloat,   getElemFloat,   getNumBanks,   getOffset,   getOffsets,   getSize,   setElem,   setElem,   setElemDouble,   setElemDouble,   setElemFloat,   setElemFloat,   toIntArray
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from java.awt.image.DataBufferByte Detail:
 public byte[][] getBankData() 
    Returns the data arrays for all banks.

    Note that calling this method may cause this {@code DataBuffer} object to be incompatible with performance optimizations used by some implementations (such as caching an associated image in video memory).

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

    Note that calling this method may cause this {@code DataBuffer} object to be incompatible with performance optimizations used by some implementations (such as caching an associated image in video memory).

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

    Note that calling this method may cause this {@code DataBuffer} object to be incompatible with performance optimizations used by some implementations (such as caching an associated image in video memory).

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