org.apache.fop.render.afp.tools
Class BinaryUtils
java.lang.Object
org.apache.fop.render.afp.tools.BinaryUtils
public final class BinaryUtils
extends java.lang.Object
Library of utility useful conversion methods.
static byte[] | convert(String digits) - Convert a String of hexadecimal digits into the corresponding
byte array by encoding each two hexadecimal digits as a byte.
|
static byte[] | convert(int integer) - Convert an int into the corresponding byte array by encoding each
two hexadecimal digits as a char.
|
static byte[] | convert(int integer, int bufsize) - Convert an int into the corresponding byte array by encoding each
two hexadecimal digits as a char.
|
static byte[] | shortToByteArray(short value) - Convert the specified short into a byte array.
|
static void | shortToByteArray(short value, byte[] array, int offset) - Convert the specified short into a byte array.
|
convert
public static byte[] convert(String digits)
Convert a String of hexadecimal digits into the corresponding
byte array by encoding each two hexadecimal digits as a byte.
digits
- The hexadecimal digits representation.
convert
public static byte[] convert(int integer)
Convert an int into the corresponding byte array by encoding each
two hexadecimal digits as a char.
integer
- The int representation
convert
public static byte[] convert(int integer,
int bufsize)
Convert an int into the corresponding byte array by encoding each
two hexadecimal digits as a char. This will return a byte array
to the length specified by bufsize.
integer
- The int representation.bufsize
- The required byte array size.
shortToByteArray
public static byte[] shortToByteArray(short value)
Convert the specified short into a byte array.
value
- The value to be converted.
shortToByteArray
public static void shortToByteArray(short value,
byte[] array,
int offset)
Convert the specified short into a byte array.
value
- The value to be converted.array
- The array to receive the data.offset
- The offset into the byte array for the start of the value.
Copyright 1999-2007 The Apache Software Foundation. All Rights Reserved.