SourceJammer 1.2.0.1 May 20, 2002
Copyright (c) 2001, 2002 Robert MacGrogan

org.sourcejammer.server.make
Class BufferedChunkCompare

java.lang.Object
  |
  +--org.sourcejammer.server.make.ByteArrayChunkCompare
        |
        +--org.sourcejammer.server.make.BufferedChunkCompare

public class BufferedChunkCompare
extends ByteArrayChunkCompare


Constructor Summary
protected BufferedChunkCompare()
           
  BufferedChunkCompare(java.io.File source, boolean provideOutputBytes)
           
 
Method Summary
 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.
protected  void finailze()
           
 int firstUnmatchedByte(BufferedChunkCompare oCompare)
           
 int getIndex()
           
 int getSizeOfSource()
           
 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.
 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
 

Constructor Detail

BufferedChunkCompare

protected BufferedChunkCompare()

BufferedChunkCompare

public BufferedChunkCompare(java.io.File source,
                            boolean provideOutputBytes)
                     throws java.io.IOException,
                            EndOfSourceException
Method Detail

setTempName

public void setTempName(java.lang.String s)

retrieveBytes

public byte[] retrieveBytes(int startIndex,
                            int length)
                     throws java.lang.IndexOutOfBoundsException,
                            java.io.IOException

nextByChunk

public boolean nextByChunk()
Description copied from class: ByteArrayChunkCompare
Advances the index of the byte array source to the next byte chunk. In other words, advances the index by the value of the ComparisonChunkSize value in AppConfig.
Overrides:
nextByChunk in class ByteArrayChunkCompare
Following copied from class: org.sourcejammer.server.make.ByteArrayChunkCompare
Returns:
true if the index advanced successfully. false if the end of the source byte array has been reached.

nextByByte

public boolean nextByByte()
Description copied from class: ByteArrayChunkCompare
Advances the index of the byte array source by 1 byte.
Overrides:
nextByByte in class ByteArrayChunkCompare
Following copied from class: org.sourcejammer.server.make.ByteArrayChunkCompare
Returns:
true if the index advanced successfully. false if the end of the source byte array has been reached.

setIndex

public void setIndex(int index)
              throws EndOfSourceException
Explicitly sets the index value.
Overrides:
setIndex in class ByteArrayChunkCompare
Throws:
EndOfSourceException - -- Requested index is not in source byte array.

setIndex

public void setIndex(int index,
                     boolean optimistic)
              throws EndOfSourceException
Explicitly sets the index value.
Parameters:
index - -- the index to move to.
optimistic - -- means "discard before" value is not modified.
Throws:
EndOfSourceException - -- Requested index is not in source byte array.

getIndex

public int getIndex()
Overrides:
getIndex in class ByteArrayChunkCompare

size

public int size()
Returns the comparison size, or the number of bytes that will be compared when the equals() method is called.
Overrides:
size in class ByteArrayChunkCompare

getSizeOfSource

public int getSizeOfSource()
Overrides:
getSizeOfSource in class ByteArrayChunkCompare

equals

public 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.
Overrides:
equals in class ByteArrayChunkCompare

firstUnmatchedByte

public int firstUnmatchedByte(BufferedChunkCompare oCompare)

close

public void close()
           throws java.io.IOException
Returns number of bytes added.

finailze

protected void finailze()
                 throws java.lang.Throwable

SourceJammer 1.2.0.1 May 20, 2002
Copyright (c) 2001, 2002 Robert MacGrogan