Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## opencard.core.util
Class HexString

    java.lang.Object
      opencard.core.util.HexString

    public class HexString

extends java.lang.Object

Small utility class to hexify bytes and shorts.

Version:
  $Id: HexString.java,v 1.1.1.1 2004/04/08 10:29:27 asc Exp $
Author:
  Michael Baentsch (mib@zurich.ibm.com), Dirk Husemann (hud@zurich.ibm.com)

Field Summary
`protected static java.lang.String[]` | `hexChars` Auxillary string array.

Constructor Summary
`HexString()`

Method Summary
`static java.lang.String` | `dump(byte[] data)` Hex-dump a byte array (offset and printable ASCII included)
`static java.lang.String` | `dump(byte[] data, int offset, int len)` Hex-dump a byte array (offset and printable ASCII included)
`static java.lang.String` | `hexify(byte[] data)` Hexify a byte array.
`static java.lang.String` | `hexify(int val)` Hexify a byte value.
`static java.lang.String` | `hexifyShort(byte a, byte b)` Hexify short value encoded in two bytes.
`static java.lang.String` | `hexifyShort(int val)` Hexify a short value.
`static java.lang.String` | `hexifyShort(int a, int b)` Hexify short value encoded in two (int-encoded)bytes.
`static byte[]` | `parseHexString(java.lang.String byteString)` Parse bytes encoded as Hexadecimals into a byte array.
`static byte[]` | `parseLittleEndianHexString(java.lang.String byteString)` Parse string of Hexadecimals into a byte array suitable for unsigned BigInteger computations.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### hexChars

    protected static final java.lang.String[] hexChars

  Auxillary string array.

Constructor Detail

### HexString

    public HexString()

Method Detail

### dump

    public static java.lang.String dump(byte[] data)

  Hex-dump a byte array (offset and printable ASCII included)

  Parameters:
    `data` - Byte array to convert to HexString
  Returns:
    HexString

### dump

    public static java.lang.String dump(byte[] data,
                                        int offset,
                                        int len)

  Hex-dump a byte array (offset and printable ASCII included)

  Parameters:
    `data` - Byte array to convert to HexString
    `offset` - Start dump here
    `len` - Number of bytes to be dumped.
  Returns:
    HexString

### hexify

    public static java.lang.String hexify(byte[] data)

  Hexify a byte array.

  Parameters:
    `data` - Byte array to convert to HexString
  Returns:
    HexString

### hexify

    public static java.lang.String hexify(int val)

  Hexify a byte value.

  Parameters:
    `val` - Byte value to be displayed as a HexString.
  Returns:
    HexString

### hexifyShort

    public static java.lang.String hexifyShort(byte a,
                                               byte b)

  Hexify short value encoded in two bytes.

  Parameters:
    `a` - High byte of short value to be hexified
    `b` - Low byte of short value to be hexified
  Returns:
    HexString

### hexifyShort

    public static java.lang.String hexifyShort(int val)

  Hexify a short value.

  Parameters:
    `val` - Short value to be displayed as a HexString.
  Returns:
    HexString

### hexifyShort

    public static java.lang.String hexifyShort(int a,
                                               int b)

  Hexify short value encoded in two (int-encoded)bytes.

  Parameters:
    `a` - High byte of short value to be hexified
    `b` - Low byte of short value to be hexified
  Returns:
    HexString

### parseHexString

    public static byte[] parseHexString(java.lang.String byteString)

  Parse bytes encoded as Hexadecimals into a byte array.

  Parameters:
    `byteString` - String containing HexBytes.
  Returns:
    byte array containing the parsed values of the given string.

### parseLittleEndianHexString

    public static byte[] parseLittleEndianHexString(java.lang.String byteString)

  Parse string of Hexadecimals into a byte array suitable for unsigned BigInteger computations. Reverse the order of the parsed data on the fly (input data little endian).

  Parameters:
    `byteString` - String containing HexBytes.
  Returns:
    byte array containing the parsed values of the given string.

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD