org.jruby.util
Class Adler32Ext

java.lang.Object
  extended by org.jruby.util.Adler32Ext
All Implemented Interfaces:
java.util.zip.Checksum

public class Adler32Ext
extends java.lang.Object
implements java.util.zip.Checksum

This class is a wrapper around Adler32 which provides the capability to update the running total. This functionality is provided by quite risky reflection and should be fixed in a better way later on.


Constructor Summary
Adler32Ext()
          Creates the basic object with default initial adler.
Adler32Ext(int adler)
          Creates the basic object with the adler provided.
 
Method Summary
 long getValue()
           
 void reset()
           
 void setAdler(int adler)
          Sets the adler running total to the specified value.
 void update(byte[] b)
           
 void update(byte[] b, int off, int len)
           
 void update(int b)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Adler32Ext

public Adler32Ext()
Creates the basic object with default initial adler.


Adler32Ext

public Adler32Ext(int adler)
Creates the basic object with the adler provided.

Parameters:
adler - the number to use as starting point for the Adler-32 algorithm
Method Detail

setAdler

public void setAdler(int adler)
Sets the adler running total to the specified value.

Parameters:
adler - the number to use as current value for the Adler-32 algorithm

update

public void update(int b)
Specified by:
update in interface java.util.zip.Checksum
See Also:
Checksum.update(int)

update

public void update(byte[] b,
                   int off,
                   int len)
Specified by:
update in interface java.util.zip.Checksum
See Also:
Checksum.update(int)

update

public void update(byte[] b)
See Also:
Checksum.update(int)

reset

public void reset()
Specified by:
reset in interface java.util.zip.Checksum
See Also:
Checksum.reset()

getValue

public long getValue()
Specified by:
getValue in interface java.util.zip.Checksum
See Also:
Checksum.getValue()


Copyright © 2002-2009 JRuby Team. All Rights Reserved.