Examples of readShort()


Examples of com.peterhi.obsolete.Stream.readShort()

      stream.writeBit(1);
     
      stream.readBit();
     
      for (int i = 0; i < sampleShorts().length; i++) {
        assertEquals(sampleShorts()[i], stream.readShort());
      }
     
      assertEquals(1, stream.getData().readable());
    } finally {
    }
View Full Code Here

Examples of davaguine.jmac.tools.ByteArrayReader.readShort()

        pWaveFormatEx.nAvgBytesPerSec = pWaveFormatEx.nBlockAlign * pWaveFormatEx.nSamplesPerSec;
    }

    public void readHeader(File io) throws IOException {
        ByteArrayReader reader = new ByteArrayReader(io, WAV_HEADER_SIZE);
        wFormatTag = reader.readShort();
        nChannels = reader.readShort();
        nSamplesPerSec = reader.readInt();
        nAvgBytesPerSec = reader.readInt();
        nBlockAlign = reader.readShort();
        wBitsPerSample = reader.readShort();
View Full Code Here

Examples of htsjdk.tribble.util.LittleEndianInputStream.readShort()

    public void testRead() throws Exception {
        LittleEndianInputStream lis = new LittleEndianInputStream(new BufferedInputStream(new FileInputStream("les_test.bin")));
        assertEquals("Binary test file", lis.readString());
        assertEquals(Float.MAX_VALUE, lis.readFloat());
        assertEquals(Byte.MAX_VALUE, lis.readByte());
        assertEquals(Short.MAX_VALUE, lis.readShort());
        assertEquals(Integer.MAX_VALUE, lis.readInt());
        assertEquals(Long.MAX_VALUE, lis.readLong());
        assertEquals(Double.MAX_VALUE, lis.readDouble());
        lis.close();
    }
View Full Code Here

Examples of io.airlift.slice.BasicSliceInput.readShort()

        checkArgument(input.readByte() == Format.SPARSE_V1.getTag(), "invalid format tag");

        indexBitLength = input.readByte();
        checkArgument(indexBitLength >= 1 && indexBitLength <= 13, "indexBitLength is out of range");

        numberOfHashes = input.readShort();
        numberOfOverflows = input.readShort();

        shortHashes = new short[numberOfHashes];
        for (int i = 0; i < numberOfHashes; i++) {
            shortHashes[i] = input.readShort();
View Full Code Here

Examples of io.netty.buffer.ByteBuf.readShort()

        if (binaryData == null || binaryData.capacity() == 0) {
            return -1;
        }

        binaryData.readerIndex(0);
        int statusCode = binaryData.readShort();
        binaryData.readerIndex(0);

        return statusCode;
    }
View Full Code Here

Examples of java.io.DataInputStream.readShort()

            DataInputStream in=new DataInputStream(new ByteArrayInputStream(buf));
            byte type=in.readByte();
            if(type == NULL)
                return null;
            if(type == METHOD_CALL) {
                short id=in.readShort();
                short length=in.readShort();
                Object[] args=length > 0? new Object[length] : null;
                if(args != null) {
                    for(int i=0; i < args.length; i++)
                        args[i]=Util.objectFromStream(in);
View Full Code Here

Examples of java.io.DataInputStream.readShort()

                    println("Bind");
                    println(" destPortal: " + readStringNull(dataIn));
                    println(" prepName: " + readStringNull(dataIn));
                    int formatCodesCount = dataIn.readShort();
                    for (int i = 0; i < formatCodesCount; i++) {
                        println(" formatCode[" + i + "]=" + dataIn.readShort());
                    }
                    int paramCount = dataIn.readShort();
                    for (int i = 0; i < paramCount; i++) {
                        int paramLen = dataIn.readInt();
                        println(" length[" + i + "]=" + paramLen);
View Full Code Here

Examples of java.io.DataInputStream.readShort()

                    println(" prepName: " + readStringNull(dataIn));
                    int formatCodesCount = dataIn.readShort();
                    for (int i = 0; i < formatCodesCount; i++) {
                        println(" formatCode[" + i + "]=" + dataIn.readShort());
                    }
                    int paramCount = dataIn.readShort();
                    for (int i = 0; i < paramCount; i++) {
                        int paramLen = dataIn.readInt();
                        println(" length[" + i + "]=" + paramLen);
                        byte[] d2 = new byte[paramLen];
                        dataIn.readFully(d2);
View Full Code Here

Examples of java.io.DataInputStream.readShort()

                        int paramLen = dataIn.readInt();
                        println(" length[" + i + "]=" + paramLen);
                        byte[] d2 = new byte[paramLen];
                        dataIn.readFully(d2);
                    }
                    int resultCodeCount = dataIn.readShort();
                    for (int i = 0; i < resultCodeCount; i++) {
                        println(" resultCodeCount[" + i + "]=" + dataIn.readShort());
                    }
                    break;
                }
View Full Code Here

Examples of java.io.DataInputStream.readShort()

                        byte[] d2 = new byte[paramLen];
                        dataIn.readFully(d2);
                    }
                    int resultCodeCount = dataIn.readShort();
                    for (int i = 0; i < resultCodeCount; i++) {
                        println(" resultCodeCount[" + i + "]=" + dataIn.readShort());
                    }
                    break;
                }
                case 'C': {
                    println("Close");
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.