|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.flagstone.transform.util.FSCodec
public class FSCodec
| Field Summary | |
|---|---|
static int |
BIG_ENDIAN
Deprecated. Identifies that multibyte words are stored in big-endian format with the most significant byte in a word stored first. |
static int |
LITTLE_ENDIAN
Deprecated. Identifies that multibyte words are stored in little-endian format with the least significant byte in a word stored first. |
| Constructor Summary | |
|---|---|
FSCodec(int order,
byte[] bytes)
Deprecated. Constructs and FSCodec object containing an array of bytes with the specified byte ordering. |
|
FSCodec(int order,
int size)
Deprecated. Constructs and FSCodec object containing an array of bytes with the specified byte ordering. |
|
| Method Summary | |
|---|---|
void |
alignToByte()
Deprecated. Moves the internal pointer forward so it is aligned on a byte boundary. |
boolean |
eof()
Deprecated. Returns true of the internal pointer is at the end of the buffer. |
boolean |
findBits(int value,
int numberOfBits,
int step)
Deprecated. Searches the internal buffer for a bit pattern and advances the pointer to the start of the bit field, returning true to signal a successful search. |
boolean |
findWord(int value,
int numberOfBytes,
int step)
Deprecated. Searches the internal buffer for a word and advances the pointer to the location where the word was found, returning true to signal a successful search. |
byte[] |
getData()
Deprecated. Returns a copy of the array of bytes. |
int |
getPosition()
Deprecated. Returns the offset, in bits, from the start of the buffer where the next value will be read or written. |
int |
readBits(int numberOfBits,
boolean signed)
Deprecated. Read a bit field from the internal buffer. |
int |
readBytes(byte[] bytes)
Deprecated. Reads an array of bytes from the internal buffer. |
int |
readWord(int numberOfBytes,
boolean signed)
Deprecated. Read a word from the internal buffer. |
void |
setData(byte[] bytes)
Deprecated. Sets the array of bytes used to read or write data to. |
void |
setData(int order,
byte[] bytes)
Deprecated. Sets the array of bytes used to read or write data to. |
void |
setPosition(int offset)
Deprecated. Sets the offset, in bits, from the start of the buffer where the next value will be read or written. |
void |
writeBits(int value,
int numberOfBits)
Deprecated. Write a bit value to the internal buffer. |
int |
writeBytes(byte[] bytes)
Deprecated. Writes an array of bytes from the internal buffer. |
void |
writeWord(int value,
int numberOfBytes)
Deprecated. Write a word to the internal buffer. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int LITTLE_ENDIAN
public static final int BIG_ENDIAN
| Constructor Detail |
|---|
public FSCodec(int order,
byte[] bytes)
order - the byte-order for words, either FSCodec.LITTLE_ENDIAN or FSCodec.BIG_ENDIAN.bytes - an array of bytes where the data will be read or written.
public FSCodec(int order,
int size)
order - the byte-order for words, either FSCodec.LITTLE_ENDIAN or FSCodec.BIG_ENDIAN.size - the size of the internal buffer to be created.| Method Detail |
|---|
public byte[] getData()
public void setData(byte[] bytes)
bytes - a byte array that will be used as the internal buffer.
public void setData(int order,
byte[] bytes)
order - the byte-order for words, either FSCodec.LITTLE_ENDIAN or FSCodec.BIG_ENDIAN.bytes - a byte array that will be used as the internal buffer.public int getPosition()
public void setPosition(int offset)
offset - the offset in bits from the start of the array of bytes.public void alignToByte()
public boolean eof()
public boolean findBits(int value,
int numberOfBits,
int step)
value - an integer containing the bit patter to search for.numberOfBits - least significant n bits in the value to search for.step - the increment in bits to add to the internal pointer as the buffer
is searched.
public boolean findWord(int value,
int numberOfBytes,
int step)
value - an integer containing the word to search for.numberOfBytes - least significant n bytes in the value to search for.step - the increment in bits to add to the internal pointer as the buffer
is searched.
public int readBits(int numberOfBits,
boolean signed)
numberOfBits - the number of bits to read.signed - a boolean flag indicating whether the value read should be sign extended.
public void writeBits(int value,
int numberOfBits)
value - an integer containing the value to be written.numberOfBits - the least significant n bits from the value that will be
written to the buffer.
public int readWord(int numberOfBytes,
boolean signed)
numberOfBytes - the number of bytes read in the range 1..4.signed - a boolean flag indicating whether the value read should be sign extended.
public void writeWord(int value,
int numberOfBytes)
value - an integer containing the value to be written.numberOfBytes - the least significant n bytes from the value that will be
written to the buffer.public int readBytes(byte[] bytes)
bytes - the array that will contain the bytes read.
public int writeBytes(byte[] bytes)
bytes - the array containing the data to be written.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||