74 lines
3.2 KiB
Java
74 lines
3.2 KiB
Java
|
|
/*
|
||
|
|
* Copyright (c) 1999,2005 Declarative Engineering LLC.
|
||
|
|
* All rights reserved. This program and the accompanying materials
|
||
|
|
* are made available under the terms of the Declarative Engineering LLC
|
||
|
|
* verson 1 which accompanies this distribution, and is available at
|
||
|
|
* http://declarativeengineering.com/legal/DE_Developer_License_v1.txt
|
||
|
|
*/
|
||
|
|
package com.common.system;
|
||
|
|
|
||
|
|
public interface ISystem {
|
||
|
|
/**
|
||
|
|
* Creates a string by reading the character bytes from a byte array beginning at a given offset.
|
||
|
|
* @param bytes The byte array containing the character data.
|
||
|
|
* @param offset The offset in the array where the character data begins.
|
||
|
|
* @param length The number of bytes of character data to read.
|
||
|
|
* @return The string represented by the character data in the byte array.
|
||
|
|
*/
|
||
|
|
public String convertUnicode16StringFromBytes(byte[] bytes, int offset, int length);
|
||
|
|
/**
|
||
|
|
* Writes the character bytes to the byte array starting at the offset.
|
||
|
|
* @param string The string to write to the byte array.
|
||
|
|
* @param bytes The byte array that should contain the string bytes.
|
||
|
|
* @param offset The offset in the array where the character bytes should begin.
|
||
|
|
* @return Will be the number of bytes written.
|
||
|
|
*/
|
||
|
|
public int convertUnicode16StringToBytes(String string, byte[] bytes, int offset);
|
||
|
|
/**
|
||
|
|
* Creates a string by reading the character bytes from a byte array beginning at a given offset.
|
||
|
|
* @param bytes The byte array containing the character data.
|
||
|
|
* @param offset The offset in the array where the character data begins.
|
||
|
|
* @param length The number of bytes of character data to read.
|
||
|
|
* @return The string represented by the character data in the byte array.
|
||
|
|
*/
|
||
|
|
public String convertUtf8StringFromBytes(byte[] bytes, int offset, int length);
|
||
|
|
/**
|
||
|
|
* Writes the character bytes to the byte array starting at the offset.
|
||
|
|
* @param string The string to write to the byte array.
|
||
|
|
* @param bytes The byte array that should contain the string bytes.
|
||
|
|
* @param offset The offset in the array where the character bytes should begin.
|
||
|
|
* @return Will be the number of bytes written.
|
||
|
|
*/
|
||
|
|
public int convertUtf8StringToBytes(String string, byte[] bytes, int offset);
|
||
|
|
/**
|
||
|
|
* Retrieves the system id for this process.
|
||
|
|
* <p>NOTE: This will only be called once per logical process, and the value will be cached and reused.
|
||
|
|
* @return The system process id.
|
||
|
|
*/
|
||
|
|
public int getProcessId();
|
||
|
|
/**
|
||
|
|
* Gets the number of bytes in the UTF8 string.
|
||
|
|
* @param string The string to get the length of.
|
||
|
|
* @return Will be the number of UTF8 bytes in the string.
|
||
|
|
*/
|
||
|
|
public int getUtf8StringLength(String string);
|
||
|
|
/**
|
||
|
|
* Creates a new instance of the given type.
|
||
|
|
* <p><b>NOTE: This will NOT call any of the constructors.</b>
|
||
|
|
* @param type The class object for the type to be instantiated.
|
||
|
|
* @return The new uninitialized object.
|
||
|
|
*/
|
||
|
|
public Object instantiateObject(Class type);
|
||
|
|
/**
|
||
|
|
* Loads the system library using the default library name and a custom path.
|
||
|
|
* @see SystemManager.setupSystem(ISystem, String, String)
|
||
|
|
*/
|
||
|
|
public void loadLibrary();
|
||
|
|
/**
|
||
|
|
* Loads the system library using the default library name and a custom path.
|
||
|
|
* @param path The path where the library can be found.
|
||
|
|
* @see SystemManager.setupSystem(ISystem, String, String)
|
||
|
|
*/
|
||
|
|
public void loadLibrary(String path);
|
||
|
|
}//ISystem//
|