Class: MemoryParser

ov.Utilities. MemoryParser

new ov.Utilities.MemoryParser(obj)

webgl/ov-Utilities.js, line 693

記憶體讀寫器

Name Type Description
obj ArrayBuffer | number

若為ArrayBuffer,則建立一個不會自動伸展的MemFile,若為number,代表當寫入時,若到檔案尾,會自動增配Obj個bytes。

Members

readonlyallocatedLength

取得配置的長度,由於可以自動伸展,每次伸展的bytes數固定,所以系統所配置的記憶體可能比實際已使用的多,而allocedLength是取得已配置的, length則是取得已使用,有資料的長度

Properties:
Name Type Description
allocatedLength Number

長度

length

長度,若長度為不可自動伸展,則無法設定改變長度

Properties:
Name Type Description
length Number

長度

littleEndian

是否為小在前排列法

Properties:
Name Type Description
littleEndian Boolean

是否為小在前排列法

readonlypos

取得目前的所在的位置

Properties:
Name Type Description
pos Number

位置

Methods

detach(){ArrayBuffer}

webgl/ov-Utilities.js, line 1048

將目前檔案內的Memory傳回,而檔案就變成初始狀態

Returns:
Type Description
ArrayBuffer 傳回檔案的內容

getData(){ArrayBuffer}

webgl/ov-Utilities.js, line 1032

複制一份檔案內的資料,並傳回

Returns:
Type Description
ArrayBuffer 傳回複制的檔案資料

getDataRef(){ArrayBuffer}

webgl/ov-Utilities.js, line 1040

傳回內部使用的記憶體

Returns:
Type Description
ArrayBuffer 傳回內部使用的記憶體

isEOF(){Boolean}

webgl/ov-Utilities.js, line 793

判斷目前的Pos是否位於最後面

Returns:
Type Description
Boolean 回傳目前的pos是否位於最後面

readAsciiString(){string}

webgl/ov-Utilities.js, line 890

從目前的位置讀取Ascii的string,string在檔案內的排放方式為[length,char1,char2...],pos會自動往後移

Returns:
Type Description
string 回傳讀取的值

readBinary(length){ArrayBuffer}

webgl/ov-Utilities.js, line 915

從目前的位置讀取一串binary資料,pos會自動往後移

Name Type Description
length number

欲讀取的資料長度。

Returns:
Type Description
ArrayBuffer 回傳讀取的值

readByte(){byte}

webgl/ov-Utilities.js, line 801

從目前的位置讀取Byte,pos會自動往後移

Returns:
Type Description
byte 回傳讀取的值

readChar(){String}

webgl/ov-Utilities.js, line 810

從目前的位置讀取一個字元,pos會自動往後移

Returns:
Type Description
String 回傳讀取的值

readChars(){String}

webgl/ov-Utilities.js, line 818

從目前的位置讀取多個字元,pos會自動往後移

Returns:
Type Description
String 回傳讀取的值

readFloat32(){Float32}

webgl/ov-Utilities.js, line 874

從目前的位置讀取Float32,pos會自動往後移

Returns:
Type Description
Float32 回傳讀取的值

readFloat64(){Float64}

webgl/ov-Utilities.js, line 882

從目前的位置讀取Float64,pos會自動往後移

Returns:
Type Description
Float64 回傳讀取的值

readInt16(){Int16}

webgl/ov-Utilities.js, line 826

從目前的位置讀取Int16,pos會自動往後移

Returns:
Type Description
Int16 回傳讀取的值

readInt32(){Int32}

webgl/ov-Utilities.js, line 842

從目前的位置讀取Int32,pos會自動往後移

Returns:
Type Description
Int32 回傳讀取的值

readInt64(){Uint32}

webgl/ov-Utilities.js, line 858

從目前的位置讀取Int64,pos會自動往後移

Returns:
Type Description
Uint32 回傳讀取的值

readPolygon(){GeoPolygon}

webgl/ov-Utilities.js, line 923

從目前的位置讀取一串GeoPolygon資料

Returns:
Type Description
GeoPolygon 回傳GeoPolygon

readUint16(){Uint16}

webgl/ov-Utilities.js, line 834

從目前的位置讀取Uint16,pos會自動往後移

Returns:
Type Description
Uint16 回傳讀取的值

readUint32(){Uint32}

webgl/ov-Utilities.js, line 850

從目前的位置讀取Uint32,pos會自動往後移

Returns:
Type Description
Uint32 回傳讀取的值

readUint64(){Uint32}

webgl/ov-Utilities.js, line 866

從目前的位置讀取Uint64,pos會自動往後移

Returns:
Type Description
Uint32 回傳讀取的值

readUnicodeString(){string}

webgl/ov-Utilities.js, line 906

從目前的位置讀取Unicode的string,string在檔案內的排放方式為[length,unicode char1,unicode char2...],pos會自動往後移

Returns:
Type Description
string 回傳讀取的值

readUtf8String(){string}

webgl/ov-Utilities.js, line 898

從目前的位置讀取UTF8的string,string在檔案內的排放方式為[length,unicode char1,unicode char2...],pos會自動往後移

Returns:
Type Description
string 回傳讀取的值

seek(pos, refPos){number}

webgl/ov-Utilities.js, line 785

移動Pos至指定位置

Name Type Description
pos number

欲移動的位置,此位置是參考RefPos。

refPos ov.Utilities.MemoryParser.ENUM_FILE_SEEK

欲移動的位置Pos的參考位置。

Returns:
Type Description
number 回傳檔案目前的Pos所在的位置

toBegin(){number}

webgl/ov-Utilities.js, line 767

移動Pos至開始處

Returns:
Type Description
number 回傳檔案目前的Pos所在的位置

toEnd(){number}

webgl/ov-Utilities.js, line 775

移動Pos至最後面

Returns:
Type Description
number 回傳檔案目前的Pos所在的位置

writeBinary(binary, offset, length){number}

webgl/ov-Utilities.js, line 1024

將一串binary資料寫入目前的位置,pos會自動往後移

Name Type Description
binary ArrayBuffer

欲寫入的資料。

offset number

欲寫入的Binary的起始處。

length number

欲寫入的資料長度。

Returns:
Type Description
number 傳回寫入的byte數

writeByte(value){number}

webgl/ov-Utilities.js, line 932

將byte寫入目前的位置,pos會自動往後移

Name Type Description
value Byte

欲寫入的資料。

Returns:
Type Description
number 傳回寫入的byte數

writeFloat32(value){number}

webgl/ov-Utilities.js, line 995

將Float32寫入目前的位置,pos會自動往後移

Name Type Description
value Float32

欲寫入的資料。

Returns:
Type Description
number 傳回寫入的byte數

writeFloat64(value){number}

webgl/ov-Utilities.js, line 1004

將Float64寫入目前的位置,pos會自動往後移

Name Type Description
value Float64

欲寫入的資料。

Returns:
Type Description
number 傳回寫入的byte數

writeInt16(value){number}

webgl/ov-Utilities.js, line 941

將Int16寫入目前的位置,pos會自動往後移

Name Type Description
value Int16

欲寫入的資料。

Returns:
Type Description
number 傳回寫入的byte數

writeInt32(value){number}

webgl/ov-Utilities.js, line 959

將Int32寫入目前的位置,pos會自動往後移

Name Type Description
value Int32

欲寫入的資料。

Returns:
Type Description
number 傳回寫入的byte數

writeInt64(value){number}

webgl/ov-Utilities.js, line 977

將Int64寫入目前的位置,pos會自動往後移

Name Type Description
value Int64

欲寫入的資料。

Returns:
Type Description
number 傳回寫入的byte數

writeUint16(value){number}

webgl/ov-Utilities.js, line 950

將Uint16寫入目前的位置,pos會自動往後移

Name Type Description
value Uint16

欲寫入的資料。

Returns:
Type Description
number 傳回寫入的byte數

writeUint32(value){number}

webgl/ov-Utilities.js, line 968

將Uint32寫入目前的位置,pos會自動往後移

Name Type Description
value Uint32

欲寫入的資料。

Returns:
Type Description
number 傳回寫入的byte數

writeUint64(value){number}

webgl/ov-Utilities.js, line 986

將Int64寫入目前的位置,pos會自動往後移

Name Type Description
value Uint64

欲寫入的資料。

Returns:
Type Description
number 傳回寫入的byte數

writeUnicodeString(value){number}

webgl/ov-Utilities.js, line 1013

將Unicode的String寫入目前的位置,在檔案內的排放方式為[length,unicode char1,unicode char2...],pos會自動往後移

Name Type Description
value Float64

欲寫入的資料。

Returns:
Type Description
number 傳回寫入的byte數