trackerBT
Class Utils

java.lang.Object
  extended by trackerBT.Utils

public class Utils
extends java.lang.Object

A set of utility methods used by several classes


Constructor Summary
Utils()
           
 
Method Summary
static java.lang.String byteArrayToByteString(byte[] in)
          Convert a byte[] array to readable string format.
static java.lang.String byteArrayToURLString(byte[] in)
           
static java.lang.String byteStringToByteArray(java.lang.String s)
           
static byte[] hash(byte[] hashThis)
          Compute the SHA1 hash of the array in parameter
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Utils

public Utils()
Method Detail

byteArrayToByteString

public static java.lang.String byteArrayToByteString(byte[] in)
Convert a byte[] array to readable string format. This makes the "hex" readable!

Parameters:
in - byte[] buffer to convert to string format
Returns:
result String buffer in String format

byteArrayToURLString

public static java.lang.String byteArrayToURLString(byte[] in)

byteStringToByteArray

public static java.lang.String byteStringToByteArray(java.lang.String s)

hash

public static byte[] hash(byte[] hashThis)
Compute the SHA1 hash of the array in parameter

Parameters:
hashThis - The array to be hashed
Returns:
byte[] The SHA1 hash