fm.liveswitch.Ascii Class Reference

ASCII encoding/decoding utility. More...

Public Member Functions

 Ascii ()
 

Static Public Member Functions

static String decode (byte[] input)
 Decodes a UTF-8 byte array to a string. More...
 
static String decode (byte[] input, int index, int length)
 Decodes a UTF-8 byte array to a string. More...
 
static byte[] encode (String input)
 Encodes a string to a UTF-8 byte array. More...
 
static int getByteCount (String input)
 Gets the number of bytes that would be returned by a call to encode. More...
 

Detailed Description

ASCII encoding/decoding utility.

Constructor & Destructor Documentation

◆ Ascii()

fm.liveswitch.Ascii.Ascii ( )

Member Function Documentation

◆ decode() [1/2]

static String fm.liveswitch.Ascii.decode ( byte[]  input)
static

Decodes a UTF-8 byte array to a string.

Parameters
inputThe input byte array.

◆ decode() [2/2]

static String fm.liveswitch.Ascii.decode ( byte[]  input,
int  index,
int  length 
)
static

Decodes a UTF-8 byte array to a string.

Parameters
inputThe input byte array.
indexThe index to start reading.
lengthThe length.

◆ encode()

static byte [] fm.liveswitch.Ascii.encode ( String  input)
static

Encodes a string to a UTF-8 byte array.

Parameters
inputThe input string.

◆ getByteCount()

static int fm.liveswitch.Ascii.getByteCount ( String  input)
static

Gets the number of bytes that would be returned by a call to encode.

Parameters
inputThe input string.