Package lejos.remote.nxt
Class AsciizCodec
- java.lang.Object
-
- lejos.remote.nxt.AsciizCodec
-
public class AsciizCodec extends java.lang.ObjectMethods to encode and decode ASCIIZ. ASCIIZ is ASCII terminated by Zero.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.Stringdecode(byte[] bytes)Convert an ASCIIZ byte array to a stringstatic byte[]encode(java.lang.String str)Encode a string as ASCIIZ
-
-
-
Method Detail
-
encode
public static byte[] encode(java.lang.String str) throws java.io.UnsupportedEncodingExceptionEncode a string as ASCIIZ- Parameters:
str- the string- Returns:
- the ASCIIZ-encoded byte array
- Throws:
java.io.UnsupportedEncodingException
-
decode
public static java.lang.String decode(byte[] bytes) throws java.io.UnsupportedEncodingExceptionConvert an ASCIIZ byte array to a string- Parameters:
bytes- the byte array- Returns:
- the String
- Throws:
java.io.UnsupportedEncodingException
-
-