|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.smardec.j2native.Argument | +--com.smardec.j2native.ZeroTerminatedString | +--com.smardec.j2native.AnsiString
AnsiString
class is a wrapper for zero-terminated string of an 8-bit
(ANSI) character declared in C as (char *).
NOTE: All string lengths include a terminating zero character unless otherwise noted.
This class should be used directly only if 8-bit characters are required
Field Summary |
Fields inherited from class com.smardec.j2native.Argument |
JAVA_SIDE, NATIVE_SIDE |
Constructor Summary | |
AnsiString()
Constructs an empty string |
|
AnsiString(java.lang.String string)
Constructs a string with specified value |
|
AnsiString(java.lang.String string,
int maxSize)
Constructs a string with specified value and sets maximum chars quantity |
Method Summary | |
java.lang.Object |
clone()
Creates and returns a copy of this object. |
void |
fromBytesValue(byte[] bytes,
int offset)
Restores itself from provided array of bytes. |
protected byte |
getCharLength()
Returns the character length |
byte[] |
toBytesValue()
Encodes itself and returns it's representation as array of bytes. |
protected void |
toBytesValue(byte[] bytes,
int offset)
Encodes itself to the provided array of bytes. |
Methods inherited from class com.smardec.j2native.ZeroTerminatedString |
equals, getLength, getMaxSize, getValue, isAutoResize, isFixedLength, read, readFromStack, setAutoResize, setMaxSize, setValue, storeToRAM, toString, write, writeToStack |
Methods inherited from class com.smardec.j2native.Argument |
finalize, free, getAlignedLength, readFromRAM, restoreFromRAM, update, writeToRAM |
Methods inherited from class java.lang.Object |
getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public AnsiString()
public AnsiString(java.lang.String string)
string
- the value to set.public AnsiString(java.lang.String string, int maxSize)
string
- the value to set.maxSize
- maximum size of the string argument in charactersMethod Detail |
protected byte getCharLength()
ZeroTerminatedString
getCharLength
in class ZeroTerminatedString
public byte[] toBytesValue()
Argument
toBytesValue
in class Argument
Argument
protected void toBytesValue(byte[] bytes, int offset)
Argument
toBytesValue
in class Argument
bytes
- array of bytes to which Argument
will be writtenoffset
- offset in arraypublic void fromBytesValue(byte[] bytes, int offset)
Argument
fromBytesValue
in class Argument
bytes
- array of bytes from which Argument
will be restoredoffset
- offset in arraypublic java.lang.Object clone()
Argument
clone
in class Argument
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |