1.1 --- a/vm/src/test/java/org/apidesign/vm4brwsr/Numbers.java Sun Nov 18 08:41:08 2012 +0100
1.2 +++ b/vm/src/test/java/org/apidesign/vm4brwsr/Numbers.java Sun Nov 18 10:00:23 2012 +0100
1.3 @@ -17,6 +17,10 @@
1.4 */
1.5 package org.apidesign.vm4brwsr;
1.6
1.7 +import java.io.ByteArrayInputStream;
1.8 +import java.io.DataInputStream;
1.9 +import java.io.IOException;
1.10 +
1.11 /**
1.12 *
1.13 * @author Jaroslav Tulach <jtulach@netbeans.org>
1.14 @@ -31,4 +35,19 @@
1.15 public static int rem(int a, int b) {
1.16 return a % b;
1.17 }
1.18 +
1.19 + static float deserFloat() throws IOException {
1.20 + byte[] arr = {(byte) 71, (byte) 84, (byte) 52, (byte) 83};
1.21 + ByteArrayInputStream is = new ByteArrayInputStream(arr);
1.22 + DataInputStream dis = new DataInputStream(is);
1.23 + float r = dis.readFloat();
1.24 + return r;
1.25 + }
1.26 + static int deserInt() throws IOException {
1.27 + byte[] arr = {(byte) 71, (byte) 84, (byte) 52, (byte) 83};
1.28 + ByteArrayInputStream is = new ByteArrayInputStream(arr);
1.29 + DataInputStream dis = new DataInputStream(is);
1.30 + return dis.readInt();
1.31 + }
1.32 +
1.33 }