net.jxta.search.util
Class HexTools

java.lang.Object
  |
  +--net.jxta.search.util.HexTools

public class HexTools
extends java.lang.Object

HexTools is a collection of methods for manipulating binary data to and from a printable hexidecimal format.


Constructor Summary
HexTools()
           
 
Method Summary
static byte byteFromHex(char hic, char loc)
          Returns a byte with the binary equivalent of the two chars passed to it
static byte[] deHexify(java.lang.String buf)
          Returns a byte array containing the binary equivalent of the string of hexidecimal characters passed to it.
static java.lang.String deHexifyChars(java.lang.String buffer, char hexor)
          Takes a string and a character and replaces all instances of the characters hexidecimal value (in the form %XX) with the character and returns the result.
static java.lang.String hexFromByte(byte buf)
          Returns a two character string with the hexidecimal representation of a byte.
static java.lang.String hexify(byte[] buf)
          Returns a string containing the hexidecimal representation of an array of bytes.
static java.lang.String hexifyChars(java.lang.String buffer, char hexor)
          Takes a string and replaces all instances of the specified character with the characters hexidecimal value in the form %XX and returns the result.
static void main(java.lang.String[] args)
          Tests HexTools
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HexTools

public HexTools()
Method Detail

hexFromByte

public static java.lang.String hexFromByte(byte buf)
Returns a two character string with the hexidecimal representation of a byte.

byteFromHex

public static byte byteFromHex(char hic,
                               char loc)
Returns a byte with the binary equivalent of the two chars passed to it

deHexify

public static byte[] deHexify(java.lang.String buf)
Returns a byte array containing the binary equivalent of the string of hexidecimal characters passed to it.

hexify

public static java.lang.String hexify(byte[] buf)
Returns a string containing the hexidecimal representation of an array of bytes.

hexifyChars

public static java.lang.String hexifyChars(java.lang.String buffer,
                                           char hexor)
Takes a string and replaces all instances of the specified character with the characters hexidecimal value in the form %XX and returns the result.

deHexifyChars

public static java.lang.String deHexifyChars(java.lang.String buffer,
                                             char hexor)
Takes a string and a character and replaces all instances of the characters hexidecimal value (in the form %XX) with the character and returns the result.

main

public static void main(java.lang.String[] args)
Tests HexTools