public final class Codec
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static byte[] |
decode(java.lang.String base64)
Decodes the specified
Base64 string to a byte array. |
static float |
decodeAngle(byte encodedAngle)
Decodes a previously encoded angle.
|
static float |
decodeAngle(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 |
encodeAnglePrecise(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 decodeAngle(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 encodeAnglePrecise(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)
Base64
string to a byte array.base64
- The Base64 string containing the encoded binary data.Base64