From cd2c51fc0a77ce4299bfcdbc83e72d62ddffd8ac Mon Sep 17 00:00:00 2001 From: Volker Berlin Date: Sun, 9 Apr 2017 12:41:47 +0200 Subject: [PATCH] use little endian for floating number --- .../jwebassembly/binary/WasmOutputStream.java | 21 +++---------------- 1 file changed, 3 insertions(+), 18 deletions(-) diff --git a/src/de/inetsoftware/jwebassembly/binary/WasmOutputStream.java b/src/de/inetsoftware/jwebassembly/binary/WasmOutputStream.java index b9db175..6c3a62a 100644 --- a/src/de/inetsoftware/jwebassembly/binary/WasmOutputStream.java +++ b/src/de/inetsoftware/jwebassembly/binary/WasmOutputStream.java @@ -115,22 +115,7 @@ class WasmOutputStream extends FilterOutputStream { */ void writeFloat( float value ) throws IOException { int i = Float.floatToIntBits( value ); - writeInt( 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 ); + writeInt32( i ); } /** @@ -143,8 +128,8 @@ class WasmOutputStream extends FilterOutputStream { */ void writeDouble( double value ) throws IOException { long l = Double.doubleToLongBits(value); - writeInt( (int)(l >>> l) ); - writeInt( (int)l ); + writeInt32( (int)l ); + writeInt32( (int)(l >>> 32) ); } /**