提交 8bc1a300 编写于 作者: L Lewy Blue

Removed unused Binary Parser methods

上级 d3eaa7f5
......@@ -3215,7 +3215,7 @@
parseProperty: function ( reader ) {
var type = reader.getChar();
var type = reader.getString(1);
switch ( type ) {
......@@ -3370,28 +3370,6 @@
},
getInt8: function () {
var value = this.dv.getInt8( this.offset );
this.offset += 1;
return value;
},
getInt8Array: function ( size ) {
var a = [];
for ( var i = 0; i < size; i ++ ) {
a.push( this.getInt8() );
}
return a;
},
getUint8: function () {
var value = this.dv.getUint8( this.offset );
......@@ -3400,20 +3378,6 @@
},
getUint8Array: function ( size ) {
var a = [];
for ( var i = 0; i < size; i ++ ) {
a.push( this.getUint8() );
}
return a;
},
getInt16: function () {
var value = this.dv.getInt16( this.offset, this.littleEndian );
......@@ -3422,42 +3386,6 @@
},
getInt16Array: function ( size ) {
var a = [];
for ( var i = 0; i < size; i ++ ) {
a.push( this.getInt16() );
}
return a;
},
getUint16: function () {
var value = this.dv.getUint16( this.offset, this.littleEndian );
this.offset += 2;
return value;
},
getUint16Array: function ( size ) {
var a = [];
for ( var i = 0; i < size; i ++ ) {
a.push( this.getUint16() );
}
return a;
},
getInt32: function () {
var value = this.dv.getInt32( this.offset, this.littleEndian );
......@@ -3488,20 +3416,6 @@
},
getUint32Array: function ( size ) {
var a = [];
for ( var i = 0; i < size; i ++ ) {
a.push( this.getUint32() );
}
return a;
},
// JavaScript doesn't support 64-bit integer so calculate this here
// 1 << 32 will return 1 so using multiply operation instead here.
// There's a possibility that this method returns wrong value if the value
......@@ -3576,20 +3490,6 @@
},
getUint64Array: function ( size ) {
var a = [];
for ( var i = 0; i < size; i ++ ) {
a.push( this.getUint64() );
}
return a;
},
getFloat32: function () {
var value = this.dv.getFloat32( this.offset, this.littleEndian );
......@@ -3642,15 +3542,16 @@
},
getChar: function () {
getString: function ( size ) {
return String.fromCharCode( this.getUint8() );
var a = new Uint8Array( size );
},
for ( var i = 0; i < size; i ++ ) {
getString: function ( size ) {
a[ i ] = this.getUint8();
}
var a = new Uint8Array( this.getUint8Array( size ) );
var nullByte = a.indexOf( 0 );
if ( nullByte >= 0 ) a = a.slice( 0, nullByte );
......@@ -3762,7 +3663,6 @@
}
// Converts ArrayBuffer to String.
function convertArrayBufferToString( buffer, from, to ) {
if ( from === undefined ) from = 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册