net.sf.rej.gui.hexeditor
Class ByteArrayDataProvider

java.lang.Object
  extended by net.sf.rej.gui.hexeditor.ByteArrayDataProvider
All Implemented Interfaces:
DataProvider

public class ByteArrayDataProvider
extends java.lang.Object
implements DataProvider

A DataProvider adapter for byte arrays.

Author:
Sami Koivu

Constructor Summary
ByteArrayDataProvider(byte[] data)
          Instanciates this provider to serve the given data.
 
Method Summary
 byte get(int index)
          Returns the byte in the given position.
 int getSize()
          Returns the size of the data in bytes.
 void set(int index, byte value)
          Sets the byte in the given position.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ByteArrayDataProvider

public ByteArrayDataProvider(byte[] data)
Instanciates this provider to serve the given data.

Parameters:
data - the data to be provided.
Method Detail

get

public byte get(int index)
Description copied from interface: DataProvider
Returns the byte in the given position.

Specified by:
get in interface DataProvider
Parameters:
index - the queried position.
Returns:
the byte in that position.

getSize

public int getSize()
Description copied from interface: DataProvider
Returns the size of the data in bytes.

Specified by:
getSize in interface DataProvider
Returns:
the size of the data abstracted by this interface.

set

public void set(int index,
                byte value)
Description copied from interface: DataProvider
Sets the byte in the given position.

Specified by:
set in interface DataProvider
Parameters:
index - the position to set.
value - new value for the byte.