|
||||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecttapeutils.impl.SimpleByteProcessor
This class provides a simple byte processor that just stores bytes.
It makes no assumption on the content of the bytes, and so does not know when a sequence of bytes is complete (other than the gap between the sequence and the next byte or end of sample).
Field Summary | |
---|---|
protected java.util.Map |
mByteEndMap
|
protected util.BlockSequence |
mBytes
The bytes. |
protected int |
mNumExpectedBytes
The expected number of bytes. |
protected SampleAnalyzer |
mSampleAnalyzer
The sample analyzer. |
Constructor Summary | |
---|---|
SimpleByteProcessor(SampleAnalyzer analyzer)
Construct the byte processor. |
|
SimpleByteProcessor(SampleAnalyzer analyzer,
int numBytes)
Construct the byte processor. |
Method Summary | |
---|---|
java.lang.String |
checkConsistent()
Checks whether the loaded bytes are consistent. |
int |
getByteIndex(int number)
Get the index in the sample for the given byte number. |
int |
getByteNumber(int index)
Get the byte value at the given position in the sample. |
void |
getByteNumber(int index,
int[] pos)
Get the byte number at the given position in the sample. |
byte[] |
getBytes()
Get the bytes. |
int |
getByteValue(int byteNumber)
Get the byte value at the given byte number. |
void |
initialize()
Initialize this object ready for processing a sample. |
int |
numBytesProcessed()
Returns the number of bytes processed. |
int |
numExpectedBytes()
Returns the number of bytes expected to be processed. |
void |
processByte(int start,
int end,
int byteValue)
Process the current byte. |
int |
undoLastByte()
Undo the last byte that was extracted.. |
void |
write(java.io.OutputStream output)
Write the bytes that have been extracted from the sample to the output stream. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected SampleAnalyzer mSampleAnalyzer
protected util.BlockSequence mBytes
protected java.util.Map mByteEndMap
protected int mNumExpectedBytes
Constructor Detail |
public SimpleByteProcessor(SampleAnalyzer analyzer)
analyzer
- The sample analyzer.public SimpleByteProcessor(SampleAnalyzer analyzer, int numBytes)
analyzer
- The sample analyzer.numBytes
- The number of bytes expected.Method Detail |
public void initialize()
initialize
in interface ByteProcessor
public void processByte(int start, int end, int byteValue)
processByte
in interface ByteProcessor
start
- The offset of the start of the byte in the sample.end
- The offset of the end of the byte in the sample.byteValue
- The byte value.public int undoLastByte()
undoLastByte
in interface ByteProcessor
public void write(java.io.OutputStream output) throws java.io.IOException
write
in interface ByteProcessor
output
- The output stream.
java.io.IOException
- An error occurred writing to the stream.public byte[] getBytes()
getBytes
in interface ByteProcessor
public int numBytesProcessed()
numBytesProcessed
in interface ByteProcessor
public int numExpectedBytes()
numExpectedBytes
in interface ByteProcessor
public int getByteNumber(int index)
getByteNumber
in interface ByteProcessor
index
- The index.
public void getByteNumber(int index, int[] pos)
getByteNumber
in interface ByteProcessor
index
- The index.pos
- An array which will contain the byte number and offset from the start of the byte.public int getByteIndex(int number)
getByteIndex
in interface ByteProcessor
number
- The byte number.
public int getByteValue(int byteNumber)
getByteValue
in interface ByteProcessor
byteNumber
- The index.
public java.lang.String checkConsistent()
checkConsistent
in interface ByteProcessor
|
||||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |