|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.sourcejammer.server.make.ByteArrayChunkCompare | +--org.sourcejammer.server.make.BufferedChunkCompare
Field Summary | |
private ByteArrayBuffer |
buffer
|
private int |
bufferChunkIndex
|
private int |
chunkIndex
|
private int |
chunkSize
|
private int |
discardBeforeIndex
|
private int |
fileSize
|
private int |
maxBufferSize
|
private int |
maxChunkSize
|
private boolean |
mbProvideOutputBytes
|
private int |
nextBufferStartIndex
|
private java.io.File |
source
|
private BytesToAddStreamer |
stmInForOutput
|
private java.lang.String |
tempName
|
Fields inherited from class org.sourcejammer.server.make.ByteArrayChunkCompare |
|
Constructor Summary | |
protected |
BufferedChunkCompare()
|
|
BufferedChunkCompare(java.io.File source,
boolean provideOutputBytes)
|
Method Summary | |
private int |
bufferIndexToFileIndex(int bufferIndex)
|
void |
close()
Returns number of bytes added. |
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 . |
private int |
fileIndexToBufferIndex(int fileIndex)
|
protected void |
finailze()
|
int |
firstUnmatchedByte(BufferedChunkCompare oCompare)
|
int |
getIndex()
|
int |
getSizeOfSource()
|
private boolean |
isFileIndexInCurrentBuffer(int fileIndex)
|
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. |
private void |
refreshBuffer()
|
byte[] |
retrieveBytes(int startIndex,
int length)
|
void |
setIndex(int index)
Explicitly sets the index value. |
void |
setIndex(int index,
boolean optimistic)
Explicitly sets the index value. |
void |
setTempName(java.lang.String s)
|
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 org.sourcejammer.server.make.ByteArrayChunkCompare |
getSource |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private java.io.File source
private int chunkIndex
private int chunkSize
private int discardBeforeIndex
private int maxBufferSize
private int maxChunkSize
private int nextBufferStartIndex
private boolean mbProvideOutputBytes
private BytesToAddStreamer stmInForOutput
private ByteArrayBuffer buffer
private int bufferChunkIndex
private int fileSize
private java.lang.String tempName
Constructor Detail |
protected BufferedChunkCompare()
public BufferedChunkCompare(java.io.File source, boolean provideOutputBytes) throws java.io.IOException, EndOfSourceException
Method Detail |
public void setTempName(java.lang.String s)
private void refreshBuffer() throws java.io.IOException
java.io.IOException
public byte[] retrieveBytes(int startIndex, int length) throws java.lang.IndexOutOfBoundsException, java.io.IOException
java.lang.IndexOutOfBoundsException
java.io.IOException
private int fileIndexToBufferIndex(int fileIndex)
private int bufferIndexToFileIndex(int bufferIndex)
public boolean nextByChunk()
ByteArrayChunkCompare
nextByChunk
in class ByteArrayChunkCompare
true
if the index advanced successfully. false
if the end of the source byte array has been reached.public boolean nextByByte()
ByteArrayChunkCompare
nextByByte
in class ByteArrayChunkCompare
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
setIndex
in class ByteArrayChunkCompare
EndOfSourceException
- -- Requested index is not in source byte array.public void setIndex(int index, boolean optimistic) throws EndOfSourceException
index
- -- the index to move to.optimistic
- -- means "discard before" value is not modified.
EndOfSourceException
- -- Requested index is not in source byte array.private boolean isFileIndexInCurrentBuffer(int fileIndex)
public int getIndex()
getIndex
in class ByteArrayChunkCompare
public int size()
equals()
method is called.
size
in class ByteArrayChunkCompare
public int getSizeOfSource()
getSizeOfSource
in class ByteArrayChunkCompare
public boolean equals(java.lang.Object o)
o
.
equals
in class ByteArrayChunkCompare
public int firstUnmatchedByte(BufferedChunkCompare oCompare)
public void close() throws java.io.IOException
java.io.IOException
protected void finailze() throws java.lang.Throwable
java.lang.Throwable
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |