ユーティリティクラス
メソッドの概要 | |
---|---|
static table
|
array(int count)
指定された個数の false 要素を含む配列を取得する
|
static number
|
band(...)
ビット演算 AND |
static number
|
bor(...)
ビット演算 OR |
static string
|
dump(? value,table option)
変数の中身をダンプする |
static table
|
explodeUTF8String(string utf8)
UTF8 の文字列を、1 文字ずつに分解した配列に変換します |
static table<int>
|
getBytesUInt16BE(int value)
16bit の unsigned int 値を Big Endian のバイト列に変換する |
static table<int>
|
getBytesUInt32BE(void data,int value)
32bit の unsigned int 値を Big Endian のバイト列に変換する |
static int
|
lshift(int n,int shift)
左シフト演算(64bitまでを考慮) |
static int
|
makeUInt16BE(table<int> bytes)
バイト配列を、16 ビットの unsigned int 値を Big Endian とみなして数値に変換する |
static int
|
makeUInt32BE(table<int> bytes)
バイト配列を、32 ビットの unsigned int 値を Big Endian とみなして数値に変換する |
static int
|
rshift(int n,int shift)
右シフト演算 |
static int
|
searchArray(table array,? value)
配列の中から、指定された要素を検索し、そのインデックスを取得する |
static void
|
sort(table array,int startIndex,int length)
配列を、範囲を指定して並び替える |
static table
|
split(string value,string splitter)
value で指定された文字列を、splitter で区切る
|
static table<int>
|
stringToArray(string s)
文字列のバイトを取り出して配列にしたものを返す |
メソッドの詳細 |
---|
public static table array(int count)
false
要素を含む配列を取得する
count
- 要素の個数
public static number band(...)
...
- 可変長引数。AND 演算を行う数値を指定する
public static number bor(...)
...
- 可変長引数。OR 演算を行う数値を指定する
public static string dump(? value, table option)
value
- ダンプする変数
option
- ダンプ時の設定値 true
を設定する true
を設定する public static table explodeUTF8String(string utf8)
utf8
- UTF8 の文字列
utf8 = "0あ"
の場合、戻り値は { { 0x30 }, { 0xE3, 0x81, 0x82 } }
となる public static table<int> getBytesUInt16BE(int value)
value
- 変換元の数値
public static table<int> getBytesUInt32BE(void data, int value)
data
-
value
- 変換元の数値
public static int lshift(int n, int shift)
n
- 演算対象の数値
shift
- シフトするビット数
public static int makeUInt16BE(table<int> bytes)
bytes
- 変換元のバイト列
public static int makeUInt32BE(table<int> bytes)
bytes
- 変換元のバイト列
public static int rshift(int n, int shift)
n
- 演算対象の数値
shift
- シフトするビット数
public static int searchArray(table array, ? value)
array
- 検索対象の配列
value
- 検索するオブジェクト
public static void sort(table array, int startIndex, int length)
array
- 並び替えるテーブル
startIndex
- 並び替える範囲の開始位置(先頭が0)
length
- 並び替える範囲の長さ
public static table split(string value, string splitter)
value
で指定された文字列を、splitter
で区切る
value
- 区切られる文字列
splitter
- 区切り文字
public static table<int> stringToArray(string s)
s
- 変換元の文字列