| |
|
| java.lang.Object org.apache.poi.contrib.poibrowser.Codec
Codec | public class Codec (Code) | | Provides utility methods for encoding and decoding hexadecimal
data.
author: Rainer Klute (klute@rainer-klute.de) - with portions from Tomcat version: $Id: Codec.java 489730 2006-12-22 19:18:16Z bayard $ since: 2002-01-24 |
Field Summary | |
final protected static byte | hexval The nibbles' hexadecimal values. |
hexval | final protected static byte hexval(Code) | | The nibbles' hexadecimal values. A nibble is a half byte.
|
decodeNibble | protected static byte decodeNibble(char c)(Code) | | Decodes a nibble.
Parameters: c - A character in the range '0'-'9' or 'A'-'F'. Lowercase is not supported here. The decoded nibble in the range 0-15 throws: IllegalArgumentException - if c is not apermitted character |
hexDecode | public static byte[] hexDecode(String s)(Code) | | Decodes the hexadecimal representation of a sequence of
bytes into a byte array. Each character in the string
represents a nibble (half byte) and must be one of the
characters '0'-'9', 'A'-'F' or 'a'-'f'.
Parameters: s - The string to be decoded The bytes throws: IllegalArgumentException - if the string does not containa valid representation of a byte sequence. |
hexEncode | public static String hexEncode(String s)(Code) | | Converts a string into its hexadecimal notation.
|
hexEncode | public static String hexEncode(byte[] s)(Code) | | Converts a byte array into its hexadecimal notation.
|
hexEncode | public static String hexEncode(byte[] s, int offset, int length)(Code) | | Converts a part of a byte array into its hexadecimal
notation.
|
hexEncode | public static String hexEncode(byte b)(Code) | | Converts a single byte into its hexadecimal notation.
|
hexEncode | public static String hexEncode(short s)(Code) | | Converts a short value (16-bit) into its hexadecimal
notation.
|
hexEncode | public static String hexEncode(int i)(Code) | | Converts an int value (32-bit) into its hexadecimal
notation.
|
hexEncode | public static String hexEncode(long l)(Code) | | Converts a long value (64-bit) into its hexadecimal
notation.
|
hexEncode | public static String hexEncode(ClassID classID)(Code) | | Converts a class ID into its hexadecimal notation.
|
|
|
|