| j2native |
| AnsiString |
| Argument |
| ArrayArgument |
| ArrayType |
| Bool |
| Callback |
| Char |
| Const |
| DelegatedArgument |
| DoubleFloat |
| FloatArgument |
| FloatType |
| Function |
| FunctionExecutionException |
| FunctionNotFoundException |
| IllegalMemoryAccessException |
| Int |
| Int16 |
| Int32 |
| Int64 |
| Int8 |
| IntegerArgument |
| IntegerType |
| J2NativeContext |
| Library |
| LibraryLoader |
| LibraryNotFoundException |
| MemoryException |
| NumericArgument |
| NumericType |
| OutOnly |
| Pointer |
| Pointer.Const |
| Pointer.OutOnly |
| Pointer.Void |
| PointerArgument |
| PointerType |
| SimpleFloat |
| StringType |
| StructuralArgument |
| Structure |
| TypedPointer |
| UInt |
| UInt16 |
| UInt32 |
| UInt8 |
| Union |
| WideChar |
| WideString |
| ZeroTerminatedString |
|  |
com.smardec.j2native
Class AnsiString
java.lang.Object
|
+--com.smardec.j2native.Argument
|
+--com.smardec.j2native.ZeroTerminatedString
|
+--com.smardec.j2native.AnsiString
- All Implemented Interfaces:
- java.lang.Cloneable, StringType
- public class AnsiString
- extends ZeroTerminatedString
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
|
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 |
|
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 |
| getLength, getMaxSize, getValue, isAutoResize, isFixedLength, read, readFromStack, setAutoResize, setMaxSize, setValue, storeToRAM, write, writeToStack |
| Methods inherited from class java.lang.Object |
| equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AnsiString
public AnsiString()
- Constructs an empty string
AnsiString
public AnsiString(java.lang.String string)
- Constructs a string with specified value
- Parameters:
- string - the value to set.
AnsiString
public AnsiString(java.lang.String string,
int maxSize)
- Constructs a string with specified value and sets maximum chars quantity
- Parameters:
- string - the value to set.
- maxSize - maximum size of the string argument in characters
getCharLength
protected byte getCharLength()
- Description copied from class: ZeroTerminatedString
- Returns the character length
- Specified by:
- getCharLength in class ZeroTerminatedString
- Returns:
- character length
toBytesValue
public byte[] toBytesValue()
- Description copied from class: Argument
- Encodes itself and returns it's representation as array of bytes.
- Specified by:
- toBytesValue in class Argument
- Returns:
- byte[] representation of
Argument
toBytesValue
protected void toBytesValue(byte[] bytes,
int offset)
- Description copied from class: Argument
- Encodes itself to the provided array of bytes.
- Specified by:
- toBytesValue in class Argument
- Parameters:
- bytes - array of bytes to which
Argument will be written- offset - offset in array
fromBytesValue
public void fromBytesValue(byte[] bytes,
int offset)
- Description copied from class: Argument
- Restores itself from provided array of bytes.
- Specified by:
- fromBytesValue in class Argument
- Parameters:
- bytes - array of bytes from which
Argument will be restored- offset - offset in array
|
|
|