Save This Page
Home » cocoon-2.1.11-src » org.apache.cocoon.poi » util » [javadoc | source]
org.apache.cocoon.poi.util
public class: ByteField [javadoc | source]
java.lang.Object
   org.apache.cocoon.poi.util.ByteField

All Implemented Interfaces:
    FixedField

representation of a byte (8-bit) field at a fixed location within a byte array
Constructor:
 public ByteField(int offset) throws ArrayIndexOutOfBoundsException 
    construct the ByteField with its offset into its containing byte array and a default value of 0
    Parameters:
    offset - of the field within its byte array
    Throws:
    ArrayIndexOutOfBoundsException - if offset is negative
    exception: ArrayIndexOutOfBoundsException - if offset is negative
 public ByteField(int offset,
    byte value) throws ArrayIndexOutOfBoundsException 
    construct the ByteField with its offset into its containing byte array and initialize its value
    Parameters:
    offset - of the field within its byte array
    value - the initial value
    Throws:
    ArrayIndexOutOfBoundsException - if offset is negative
    exception: ArrayIndexOutOfBoundsException - if offset is negative
 public ByteField(int offset,
    byte[] data) throws ArrayIndexOutOfBoundsException 
    Construct the ByteField with its offset into its containing byte array and initialize its value from its byte array
    Parameters:
    offset - of the field within its byte array
    data - the byte array to read the value from
    Throws:
    ArrayIndexOutOfBoundsException - if the offset is not within the range of 0..(data.length - 1)
    exception: ArrayIndexOutOfBoundsException - if the offset is not within the range of 0..(data.length - 1)
 public ByteField(int offset,
    byte value,
    byte[] data) throws ArrayIndexOutOfBoundsException 
    construct the ByteField with its offset into its containing byte array, initialize its value, and write its value to its byte array
    Parameters:
    offset - of the field within its byte array
    value - the initial value
    data - the byte array to write the value to
    Throws:
    ArrayIndexOutOfBoundsException - if the offset is not within the range of 0..(data.length - 1)
    exception: ArrayIndexOutOfBoundsException - if the offset is not within the range of 0..(data.length - 1)
Method from org.apache.cocoon.poi.util.ByteField Summary:
get,   readFromBytes,   readFromStream,   set,   set,   toString,   writeToBytes
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.apache.cocoon.poi.util.ByteField Detail:
 public byte get() 
    get the ByteField's current value
 public  void readFromBytes(byte[] data) throws ArrayIndexOutOfBoundsException 
    set the value from its offset into an array of bytes
 public  void readFromStream(InputStream stream) throws IOException, BufferUnderrunException 
    set the value from an InputStream
 public  void set(byte value) 
    set the ByteField's current value
 public  void set(byte value,
    byte[] data) throws ArrayIndexOutOfBoundsException 
    set the ByteField's current value and write it to a byte array
 public String toString() 
    return the value as a String
 public  void writeToBytes(byte[] data) throws ArrayIndexOutOfBoundsException 
    write the value out to an array of bytes at the appropriate offset