public final class Codec
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
static byte[] |
decode(java.lang.String base64) |
static float |
decodeAngle(byte encodedAngle)
Decodes a previously encoded angle.
|
static float |
decodeAngleFromShort(short encodedAngle) |
static java.awt.image.BufferedImage |
decodeImage(java.lang.String imageString) |
static float |
decodeSmallFloatingPointNumber(short encodedNumber,
int precision)
Decodes a small floating point number, previously encoded with
encodeSmallFloatingPointNumber. |
static java.lang.String |
encode(java.awt.image.BufferedImage image) |
static java.lang.String |
encode(java.awt.image.BufferedImage image,
ImageFormat imageFormat) |
static java.lang.String |
encode(byte[] data) |
static byte |
encodeAngle(float angle)
Encodes an angle, loosing some precision.
|
static short |
encodeAngleToShort(float angle) |
static short |
encodeSmallFloatingPointNumber(float smallNumber,
int precision)
Encodes positive numbers less than Short.MAX_VALUE * 2 / precision (6553.4
for precision = 1).
|
public static float decodeAngle(byte encodedAngle)
encodedAngle - The encoded angle.public static float decodeAngleFromShort(short encodedAngle)
public static float decodeSmallFloatingPointNumber(short encodedNumber,
int precision)
encodeSmallFloatingPointNumber.encodedNumber - The encoded numberprecision - The precision of the encoded number. The same precision, used for
encoding.public static byte encodeAngle(float angle)
angle - The anglepublic static short encodeAngleToShort(float angle)
public static short encodeSmallFloatingPointNumber(float smallNumber,
int precision)
smallNumber - The small number to encodeprecision - The comma precision for the encoding process.public static java.awt.image.BufferedImage decodeImage(java.lang.String imageString)
public static java.lang.String encode(java.awt.image.BufferedImage image)
public static java.lang.String encode(java.awt.image.BufferedImage image,
ImageFormat imageFormat)
public static java.lang.String encode(byte[] data)
public static byte[] decode(java.lang.String base64)