com.foxsmart.ic.io
Class CRC32File

java.lang.Object
  extended by java.util.zip.CRC32
      extended by com.foxsmart.ic.io.CRC32File
All Implemented Interfaces:
java.util.zip.Checksum

public class CRC32File
extends java.util.zip.CRC32

This class provides the ability to checksum a file. It provides the same functionality as CRC32File, but has been extended for file support.


Constructor Summary
CRC32File()
          Constructs an CRC32File object
 
Method Summary
static void main(java.lang.String[] args)
          Test Driver.
 void update(java.io.File file)
          Updates the checksum based on the passed in File.
 void update(java.lang.String filename)
          Updates the checksum based on the passed in Filename.
 
Methods inherited from class java.util.zip.CRC32
getValue, reset, update, update, update
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CRC32File

public CRC32File()
Constructs an CRC32File object

Method Detail

update

public void update(java.io.File file)
            throws java.io.IOException,
                   java.net.UnknownServiceException,
                   java.io.FileNotFoundException
Updates the checksum based on the passed in File.

Parameters:
file - The file to checksum.
Throws:
java.io.FileNotFoundException - if the file specified could not be found
java.io.IOException - if the input stream could not be opened to the file.
java.net.UnknownServiceException - if the URL protocol does not support input

update

public void update(java.lang.String filename)
            throws java.io.IOException,
                   java.net.UnknownServiceException,
                   java.io.FileNotFoundException
Updates the checksum based on the passed in Filename.

Parameters:
filename - The filename of the file to checksum.
Throws:
java.io.FileNotFoundException - if the file specified could not be found
java.io.IOException - if the input stream could not be opened to the file.
java.net.UnknownServiceException - if the URL protocol does not support input

main

public static void main(java.lang.String[] args)
Test Driver.

Parameters:
args - the arguments


Copyright © 2005-2008 Fox Smart, Inc. All Rights Reserved.