|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.poi.contrib.poibrowser.Codec
public class Codec
Provides utility methods for encoding and decoding hexadecimal data.
Field Summary | |
---|---|
protected static byte[] |
hexval
The nibbles' hexadecimal values. |
Constructor Summary | |
---|---|
Codec()
|
Method Summary | |
---|---|
protected static byte |
decodeNibble(char c)
Decodes a nibble. |
static byte[] |
hexDecode(java.lang.String s)
Decodes the hexadecimal representation of a sequence of bytes into a byte array. |
static java.lang.String |
hexEncode(byte b)
Converts a single byte into its hexadecimal notation. |
static java.lang.String |
hexEncode(byte[] s)
Converts a byte array into its hexadecimal notation. |
static java.lang.String |
hexEncode(byte[] s,
int offset,
int length)
Converts a part of a byte array into its hexadecimal notation. |
static java.lang.String |
hexEncode(ClassID classID)
Converts a class ID into its hexadecimal notation. |
static java.lang.String |
hexEncode(int i)
Converts an int value (32-bit) into its hexadecimal notation. |
static java.lang.String |
hexEncode(long l)
Converts a long value (64-bit) into its hexadecimal notation. |
static java.lang.String |
hexEncode(short s)
Converts a short value (16-bit) into its hexadecimal notation. |
static java.lang.String |
hexEncode(java.lang.String s)
Converts a string into its hexadecimal notation. |
static void |
main(java.lang.String[] args)
For testing. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final byte[] hexval
The nibbles' hexadecimal values. A nibble is a half byte.
Constructor Detail |
---|
public Codec()
Method Detail |
---|
public static java.lang.String hexEncode(java.lang.String s)
Converts a string into its hexadecimal notation.
public static java.lang.String hexEncode(byte[] s)
Converts a byte array into its hexadecimal notation.
public static java.lang.String hexEncode(byte[] s, int offset, int length)
Converts a part of a byte array into its hexadecimal notation.
public static java.lang.String hexEncode(byte b)
Converts a single byte into its hexadecimal notation.
public static java.lang.String hexEncode(short s)
Converts a short value (16-bit) into its hexadecimal notation.
public static java.lang.String hexEncode(int i)
Converts an int value (32-bit) into its hexadecimal notation.
public static java.lang.String hexEncode(long l)
Converts a long value (64-bit) into its hexadecimal notation.
public static java.lang.String hexEncode(ClassID classID)
Converts a class ID into its hexadecimal notation.
public static byte[] hexDecode(java.lang.String s)
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'.
s
- The string to be decoded
java.lang.IllegalArgumentException
- if the string does not contain
a valid representation of a byte sequence.protected static byte decodeNibble(char c)
Decodes a nibble.
c
- A character in the range '0'-'9' or 'A'-'F'. Lower
case is not supported here.
java.lang.IllegalArgumentException
- if c is not a
permitted characterpublic static void main(java.lang.String[] args) throws java.io.IOException
For testing.
java.io.IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |