Examples of readByte()


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

    @Test
    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.readByte()

    public SparseHll(Slice serialized)
    {
        BasicSliceInput input = serialized.getInput();

        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();
View Full Code Here

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

    }

    @Override
    protected void decode(final ChannelHandlerContext channelHandlerContext, final BinaryWebSocketFrame frame, final List<Object> objects) throws Exception {
        final ByteBuf messageBytes = frame.content();
        final byte len = messageBytes.readByte();
        if (len <= 0) {
            objects.add(RequestMessage.INVALID);
            return;
        }
View Full Code Here

Examples of io.netty.buffer.ByteBufInputStream.readByte()

    //
    // 1. Convert message to a stream that can be decoded.
    ByteBuf buf = (ByteBuf) msg;
    ByteBufInputStream inputStream = new ByteBufInputStream(buf);
    // 2. Get first byte: message type:
    int enumValue = inputStream.readByte();
    RequestType type = RequestType.values()[enumValue];
    if (LOG.isDebugEnabled()) {
      LOG.debug("decode: Got a response of type " + type + " from server:" +
        ctx.channel().remoteAddress());
    }
View Full Code Here

Examples of io.netty.buffer.ChannelBuffer.readByte()

      return message;
    } else {
      if(buffer.readableBytes() == 0)
        return new KeepAliveMessage();
     
      final byte opcode = buffer.readByte();
      final PeerWireMessage message;
      switch (opcode) {
      case CancelMessage.MESSAGE_ID:
        message = new CancelMessage();
        break;
View Full Code Here

Examples of java.io.DataInputStream.readByte()

        public Object objectFromByteBuffer(byte[] buf) throws Exception {
            if(buf == null)
                return null;

            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();
View Full Code Here

Examples of java.io.ObjectInput.readByte()

        final XDMTreeBuilder handler = new XDMTreeBuilder();
        final List<Item> items = new ArrayList<Item>(256);
        boolean prevNodeStart = false;
        final ObjectInput input = _input;
        while(true) {
            final byte ev = input.readByte();
            if(ev == XQEventEncoder.EV_EOF) {
                handler.endItem(true);
                break;
            }
            switch(ev) {
View Full Code Here

Examples of java.io.ObjectInputStream.readByte()

      oos.close();

      ObjectInputStream ois = new ObjectInputStream(new ByteArrayInputStream(baos.toByteArray()));

      // test that the first thing on the stream is the fqn!
      byte magic = ois.readByte();
      short ref = ois.readShort();
      assert magic == CacheMarshaller200.MAGICNUMBER_FQN;

      // now the chunks of an Fqn
      Fqn f = cm200.unmarshallFqn(ois, new UnmarshalledReferences());
View Full Code Here

Examples of java.io.RandomAccessFile.readByte()

      Preconditions.checkState(open, "File closed");
      RandomAccessFile fileHandle = checkOut();
      boolean error = true;
      try {
        fileHandle.seek(offset);
        byte operation = fileHandle.readByte();
        Preconditions.checkState(operation == OP_RECORD,
            Integer.toHexString(operation));
        TransactionEventRecord record = doGet(fileHandle);
        if(!(record instanceof Put)) {
          Preconditions.checkState(false, "Record is " +
View Full Code Here

Examples of javax.imageio.stream.ImageInputStream.readByte()

        h.check(i.read() == 114);
        i.seek(0);
        h.check(i.readBoolean() == true);
        i.seek(0);
        h.check(i.readByte() == 114);
        i.seek(0);
        h.check(i.readChar() == '\u7270');
        i.seek(0);
        h.check(Double.compare(i.readDouble(), 1.709290273164385E243) == 0);
        i.seek(0);
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.