|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.sourcejammer.server.make.ByteArrayChunkCompare
This class allows simple iteration through a byte array for the purpose of comparing a chunk of bytes of a specified size.
Field Summary | |
private byte[] |
mbySource
|
private int |
miIndex
|
private int |
miSize
|
Constructor Summary | |
protected |
ByteArrayChunkCompare()
|
|
ByteArrayChunkCompare(byte[] source)
Create a new ByteArrayChunkCompare object for a byte array, beginning with the first byte in the array. |
|
ByteArrayChunkCompare(byte[] source,
int iBeginIndex)
Create a new ByteArrayChunkCompare object for a byte array, beginning with a specified index. |
Method Summary | |
boolean |
equals(java.lang.Object o)
Tests if the current chunk of bytes in this ByteArrayChunkCompare object is equal to the current chunk of bytes in o . |
int |
getIndex()
|
int |
getSizeOfSource()
|
protected byte[] |
getSource()
|
boolean |
nextByByte()
Advances the index of the byte array source by 1 byte. |
boolean |
nextByChunk()
Advances the index of the byte array source to the next byte chunk. |
void |
setIndex(int index)
Explicitly sets the index value. |
int |
size()
Returns the comparison size, or the number of bytes that will be compared when the equals() method is called. |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private byte[] mbySource
private int miIndex
private int miSize
Constructor Detail |
protected ByteArrayChunkCompare()
public ByteArrayChunkCompare(byte[] source) throws EndOfSourceException
source
- -- a byte array to be iterated through and compared.
EndOfSourceException
- -- if the source is 0 length array.public ByteArrayChunkCompare(byte[] source, int iBeginIndex) throws EndOfSourceException
source
- -- a byte array to be iterated through and compared.iBeginIndex
- -- the index at which iteration through source should begin.
Note: index is 0-based. 0 is first, 1 is second, . . .
EndOfSourceException
- -- iBeginIndex is not in source.Method Detail |
public boolean nextByChunk()
true
if the index advanced successfully. false
if the end of the source byte array has been reached.public boolean nextByByte()
true
if the index advanced successfully. false
if the end of the source byte array has been reached.public void setIndex(int index) throws EndOfSourceException
EndOfSourceException
- -- Requested index is not in source byte array.public int getIndex()
public int size()
equals()
method is called.
public int getSizeOfSource()
public boolean equals(java.lang.Object o)
o
.
equals
in class java.lang.Object
protected byte[] getSource()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |