mirror of
https://github.com/i-net-software/JWebAssembly.git
synced 2025-03-25 15:37:52 +01:00
use little endian for floating number
This commit is contained in:
parent
dc4067c745
commit
cd2c51fc0a
@ -115,22 +115,7 @@ class WasmOutputStream extends FilterOutputStream {
|
|||||||
*/
|
*/
|
||||||
void writeFloat( float value ) throws IOException {
|
void writeFloat( float value ) throws IOException {
|
||||||
int i = Float.floatToIntBits( value );
|
int i = Float.floatToIntBits( value );
|
||||||
writeInt( i );
|
writeInt32( i );
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Write an integer value as big endian (ever 4 bytes).
|
|
||||||
*
|
|
||||||
* @param value
|
|
||||||
* the value
|
|
||||||
* @throws IOException
|
|
||||||
* if an I/O error occurs.
|
|
||||||
*/
|
|
||||||
void writeInt( int value ) throws IOException {
|
|
||||||
write( value >>> 24 );
|
|
||||||
write( value >>> 16 );
|
|
||||||
write( value >>> 8 );
|
|
||||||
write( value >>> 0 );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -143,8 +128,8 @@ class WasmOutputStream extends FilterOutputStream {
|
|||||||
*/
|
*/
|
||||||
void writeDouble( double value ) throws IOException {
|
void writeDouble( double value ) throws IOException {
|
||||||
long l = Double.doubleToLongBits(value);
|
long l = Double.doubleToLongBits(value);
|
||||||
writeInt( (int)(l >>> l) );
|
writeInt32( (int)l );
|
||||||
writeInt( (int)l );
|
writeInt32( (int)(l >>> 32) );
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user