org.apache.poi.hpsf.littleendian
Class LittleEndian

java.lang.Object
  |
  +--org.apache.poi.hpsf.littleendian.LittleEndian
Direct Known Subclasses:
Byte, ClassID, DWord, Word

public abstract class LittleEndian
extends java.lang.Object

A data item in the little-endian format. Little-endian means that lower bytes come before higher bytes.

Since:
2002-02-09
Version:
$Id$
Author:
Rainer Klute (klute@rainer-klute.de)

Field Summary
protected  byte[] bytes
          The bytes making out the little-endian field.
 
Constructor Summary
LittleEndian(byte[] src, int offset)
          Creates a LittleEndian and reads its value from a byte array.
 
Method Summary
 byte[] getBytes()
          Returns the bytes making out the little-endian field in big-endian order.
abstract  int length()
          Returns the number of bytes of this little-endian field.
 byte[] read(byte[] src, int offset)
          Reads the little-endian field from a byte array.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

bytes

protected byte[] bytes

The bytes making out the little-endian field. They are in correct order, i.e. high-endian.

Constructor Detail

LittleEndian

public LittleEndian(byte[] src,
                    int offset)

Creates a LittleEndian and reads its value from a byte array.

Parameters:
src - The byte array to read from.
offset - The offset of the first byte to read.
Method Detail

getBytes

public byte[] getBytes()

Returns the bytes making out the little-endian field in big-endian order.


read

public byte[] read(byte[] src,
                   int offset)

Reads the little-endian field from a byte array.

Parameters:
src - The byte array to read from
offset - The offset within the src byte array

length

public abstract int length()

Returns the number of bytes of this little-endian field.



Copyright © 2001-2002 JAKARTA POI project. All Rights Reserved.