vm/src/test/java/org/apidesign/vm4brwsr/Numbers.java
brancharithmetic
changeset 627 4c2b92281cdc
parent 620 189f695d0b02
child 628 e606853325f1
     1.1 --- a/vm/src/test/java/org/apidesign/vm4brwsr/Numbers.java	Thu Jan 31 15:26:09 2013 +0100
     1.2 +++ b/vm/src/test/java/org/apidesign/vm4brwsr/Numbers.java	Thu Jan 31 20:19:38 2013 +0100
     1.3 @@ -111,4 +111,20 @@
     1.4          DataInputStream disValue = new DataInputStream(isValue);
     1.5          return (disValue.readLong() >> nBits);
     1.6      }
     1.7 +    
     1.8 +    public static long andL(byte[] arrX, byte[] arrY) throws IOException {
     1.9 +        ByteArrayInputStream isX = new ByteArrayInputStream(arrX);
    1.10 +        DataInputStream disX = new DataInputStream(isX);
    1.11 +        ByteArrayInputStream isY = new ByteArrayInputStream(arrY);
    1.12 +        DataInputStream disY = new DataInputStream(isY);
    1.13 +        return (disX.readLong() & disY.readLong());
    1.14 +    }
    1.15 +    
    1.16 +    public static long orL(byte[] arrX, byte[] arrY) throws IOException {
    1.17 +        ByteArrayInputStream isX = new ByteArrayInputStream(arrX);
    1.18 +        DataInputStream disX = new DataInputStream(isX);
    1.19 +        ByteArrayInputStream isY = new ByteArrayInputStream(arrY);
    1.20 +        DataInputStream disY = new DataInputStream(isY);
    1.21 +        return (disX.readLong() | disY.readLong());
    1.22 +    }
    1.23  }