org.maachang.jni.io
クラス DirectMemoryIO

java.lang.Object
  上位を拡張 org.maachang.jni.io.DirectMemoryIO

public final class DirectMemoryIO
extends java.lang.Object

メモリ直接操作処理.

導入されたバージョン:
SeabassNativeIO-1.0.0
バージョン:
2010/06/04
作成者:
masahito suzuki

メソッドの概要
static boolean equals(long srcAddr, int srcOff, long destAddr, int destOff, int length)
          バイナリ情報比較.
static long fnv64(long address, int offset, int length)
          fnvHash計算.
static void free(long address)
          free.
static byte get(long address, int index)
          1バイトの情報を取得.
static int getBinary(long address, int index, byte[] value, int offset, int length)
          binary情報を取得.
static boolean getBoolean(long address, int index)
          boolean取得.
static char getChar(long address, int index)
          char取得.
static double getDouble(long address, int index)
          double取得.
static float getFloat(long address, int index)
          float取得.
static int getInt(long address, int index)
          int取得.
static long getLong(long address, int index)
          long取得.
static short getShort(long address, int index)
          short取得.
static int indexOf(long address, int index, int length, byte[] binary)
          IndexOf.
static int lastIndexOf(long address, int index, int length, byte[] binary)
          lastIndexOf.
static long malloc(int size)
          malloc.
static void memcpy(long destAddr, long srcAddr, int size)
          memcpy.
static void memset(long address, byte code, int size)
          memset.
static void put(long address, int index, byte value)
          1バイトの情報を設定.
static int putBinary(long address, int index, byte[] value, int offset, int length)
          binary情報を設定.
static void putBoolean(long address, int index, boolean value)
          boolean設定.
static void putChar(long address, int index, char value)
          char設定.
static void putDouble(long address, int index, double value)
          double設定.
static void putFloat(long address, int index, float value)
          float設定.
static void putInt(long address, int index, int value)
          int設定.
static void putLong(long address, int index, long value)
          long設定.
static void putShort(long address, int index, short value)
          short設定.
static long realloc(long address, int size)
          realloc.
 
クラス java.lang.Object から継承されたメソッド
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

メソッドの詳細

malloc

public static final long malloc(int size)
malloc.

パラメータ:
size - 生成対象のメモリサイズを設定します.
戻り値:
long 生成された先頭アドレスが返されます.

realloc

public static final long realloc(long address,
                                 int size)
realloc.

パラメータ:
address - 対象のメモリ先頭アドレスを設定します.
size - 再生成対象のメモリサイズを設定します.
戻り値:
long 再生成された先頭アドレスが返されます.

free

public static final void free(long address)
free.

パラメータ:
address - メモリ解放対象のアドレスを設定します.

memset

public static final void memset(long address,
                                byte code,
                                int size)
memset.

パラメータ:
address - 対象のメモリ先頭アドレスを設定します.
code - 指定値を設定します.
size - 指定値設定のサイズを設定します.

memcpy

public static final void memcpy(long destAddr,
                                long srcAddr,
                                int size)
memcpy.

パラメータ:
destAddr - コピー先のメモリアドレスを設定します.
srcAddr - コピー元のメモリアドレスを設定します.
size - コピーサイズを設定します.

get

public static final byte get(long address,
                             int index)
1バイトの情報を取得.

パラメータ:
address - 対象のアドレスを設定します.
index - 対象のインデックス位置を設定します.
戻り値:
byte バイト情報が返されます.

put

public static final void put(long address,
                             int index,
                             byte value)
1バイトの情報を設定.

パラメータ:
address - 対象のアドレスを設定します.
index - 対象のインデックス位置を設定します.
value - 対象の1バイト情報を設定します.

putBinary

public static int putBinary(long address,
                            int index,
                            byte[] value,
                            int offset,
                            int length)
binary情報を設定.

パラメータ:
address - 対象のアドレスを設定します.
index - 対象のインデックス位置を設定します.
value - 設定対象の情報を設定します.
offset - 対象のオフセット値を設定します.
length - 対象のデータ長を設定します.
戻り値:
int 設定された長さが返されます.

getBinary

public static int getBinary(long address,
                            int index,
                            byte[] value,
                            int offset,
                            int length)
binary情報を取得.

パラメータ:
address - 対象のアドレスを設定します.
index - 対象のインデックス位置を設定します.
value - 取得対象の情報を設定します.
offset - 対象のオフセット値を設定します.
length - 対象のデータ長を設定します.
戻り値:
int 設定された長さが返されます.

putBoolean

public static void putBoolean(long address,
                              int index,
                              boolean value)
boolean設定.

パラメータ:
address - 対象のアドレスを設定します.
index - 対象のインデックス位置を設定します.
value - 設定対象の情報を設定します.

getBoolean

public static boolean getBoolean(long address,
                                 int index)
boolean取得.

パラメータ:
address - 対象のアドレスを設定します.
index - 対象のインデックス位置を設定します.
戻り値:
boolean 情報が返されます.

putChar

public static void putChar(long address,
                           int index,
                           char value)
char設定.

パラメータ:
address - 対象のアドレスを設定します.
index - 対象のインデックス位置を設定します.
value - 設定対象の情報を設定します.

getChar

public static char getChar(long address,
                           int index)
char取得.

パラメータ:
address - 対象のアドレスを設定します.
index - 対象のインデックス位置を設定します.
戻り値:
char 情報が返されます.

putShort

public static void putShort(long address,
                            int index,
                            short value)
short設定.

パラメータ:
address - 対象のアドレスを設定します.
index - 対象のインデックス位置を設定します.
value - 設定対象の情報を設定します.

getShort

public static short getShort(long address,
                             int index)
short取得.

パラメータ:
address - 対象のアドレスを設定します.
index - 対象のインデックス位置を設定します.
戻り値:
short 情報が返されます.

putInt

public static void putInt(long address,
                          int index,
                          int value)
int設定.

パラメータ:
address - 対象のアドレスを設定します.
index - 対象のインデックス位置を設定します.
value - 設定対象の情報を設定します.

getInt

public static int getInt(long address,
                         int index)
int取得.

パラメータ:
address - 対象のアドレスを設定します.
index - 対象のインデックス位置を設定します.
戻り値:
int 情報が返されます.

putLong

public static void putLong(long address,
                           int index,
                           long value)
long設定.

パラメータ:
address - 対象のアドレスを設定します.
index - 対象のインデックス位置を設定します.
value - 設定対象の情報を設定します.

getLong

public static long getLong(long address,
                           int index)
long取得.

パラメータ:
address - 対象のアドレスを設定します.
index - 対象のインデックス位置を設定します.
戻り値:
long 情報が返されます.

putFloat

public static void putFloat(long address,
                            int index,
                            float value)
float設定.

パラメータ:
address - 対象のアドレスを設定します.
index - 対象のインデックス位置を設定します.
value - 設定対象の情報を設定します.

getFloat

public static float getFloat(long address,
                             int index)
float取得.

パラメータ:
address - 対象のアドレスを設定します.
index - 対象のインデックス位置を設定します.
戻り値:
float 情報が返されます.

putDouble

public static void putDouble(long address,
                             int index,
                             double value)
double設定.

パラメータ:
address - 対象のアドレスを設定します.
index - 対象のインデックス位置を設定します.
value - 設定対象の情報を設定します.

getDouble

public static double getDouble(long address,
                               int index)
double取得.

パラメータ:
address - 対象のアドレスを設定します.
index - 対象のインデックス位置を設定します.
戻り値:
double 情報が返されます.

equals

public static final boolean equals(long srcAddr,
                                   int srcOff,
                                   long destAddr,
                                   int destOff,
                                   int length)
バイナリ情報比較.

パラメータ:
srcAddr - 比較元バイナリ先頭アドレスを設定します.
srcOff - 比較元バイナリオフセット値を設定します.
destAddr - 比較先バイナリ先頭アドレスを設定します.
destOff - 比較先バイナリオフセット値を設定します.
length - 比較するのバイナリ長を設定します.
戻り値:
boolean [true]の場合、バイナリ内容は一致します.

fnv64

public static final long fnv64(long address,
                               int offset,
                               int length)
fnvHash計算.

パラメータ:
address - 対象のアドレスを設定します.
offset - 対象のオフセット値を設定します.
length - 対象の長さを設定します.
戻り値:
long 計算された結果が返されます.

indexOf

public static final int indexOf(long address,
                                int index,
                                int length,
                                byte[] binary)
IndexOf.

パラメータ:
address - 対象のアドレスを設定します.
offset - 対象のオフセット値を設定します.
length - 対象の長さを設定します.
binary - 操作対象のデータを設定します.
戻り値:
int 操作位置が返されます.

lastIndexOf

public static final int lastIndexOf(long address,
                                    int index,
                                    int length,
                                    byte[] binary)
lastIndexOf.

パラメータ:
address - 対象のアドレスを設定します.
offset - 対象のオフセット値を設定します.
length - 対象の長さを設定します.
binary - 操作対象のデータを設定します.
戻り値:
int 操作位置が返されます.