SunSPOT API V3.0


com.sun.spot.util
Class CRC

java.lang.Object
  extended by com.sun.spot.util.CRC

public class CRC
extends Object

Standalone class to provide crc calculations.


Constructor Summary
CRC()
           
 
Method Summary
static short crc(byte[] buf, int offset, int len)
          Return the CRC of the specified part of a byte array.
static short crc(InputStream stream, int flashedByteCount)
          Return the CRC value of the specified number of bytes from an InputStream.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CRC

public CRC()
Method Detail

crc

public static short crc(byte[] buf,
                        int offset,
                        int len)
Return the CRC of the specified part of a byte array.

Parameters:
buf - source of bytes
offset - offset in buf to first byte
len - number of bytes to include in calculation
Returns:
16-bit CRC value

crc

public static short crc(InputStream stream,
                        int flashedByteCount)
                 throws IOException
Return the CRC value of the specified number of bytes from an InputStream.

Parameters:
stream - to read bytes from
flashedByteCount - number of bytes to read
Returns:
16-bit CRC value
Throws:
IOException

SunSPOT API V3.0


Copyright © 2006, 2007 Sun Microsystems, Inc. All Rights Reserved.