|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.iids.aos.util.RawString
public class RawString
| Constructor Summary | |
|---|---|
RawString()
|
|
| Method Summary | |
|---|---|
static java.lang.String |
byteArray2String(byte[] input)
Create string from byte[] but strip null-bytes from input. |
static byte[] |
string2ByteArrayOf(java.lang.String contents,
int arraysize)
Convert String to byte[] of fixed max size. |
static int |
strlen(byte[] input)
'Classic' strlen function. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public RawString()
| Method Detail |
|---|
public static int strlen(byte[] input)
public static byte[] string2ByteArrayOf(java.lang.String contents,
int arraysize)
Useful for interaction with AOS kernel, which uses fixed size Strings in its TOC entries.
There will always be a terminating null character, if the String does not fit then the result will be truncated. No more than contents.length() bytes will be copied, the result is padded with zero bytes (just like a C string).
contents - String contents to fill byte arrayarraysize - Exact size of the resulting array.
arraysize-1 bytes
from contents copied into it. The rest of the array is padded with
zero bytes. The last byte of the array is always zero (C string style)public static java.lang.String byteArray2String(byte[] input)
Convert byte[] to String. If it has any trailing zero bytes then these
are not part of the resulting String. This is different to what the
String(byte[]) constructor does, because this constructor
includes these zero bytes in the resulting String.
input - byte[] to convert to a String.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||