Examples of readInt()


Examples of org.jboss.netty.buffer.BigEndianHeapChannelBuffer.readInt()

        ChannelBuffer buf = (ChannelBuffer) encoder.encode(null, null, query);
        ChannelBuffer buf2 = new BigEndianHeapChannelBuffer(buf.readableBytes() + 8);
        buf2.writeInt(123);
        buf2.writeBytes(buf);

        buf2.readInt();
        ProtobufDecoder decoder = new ProtobufDecoder();
        decoder.addMessageType(Query.getDefaultInstance());
        Message message = (Message) decoder.decode(null, null, buf2);
        assertEquals(query, message);
    }
View Full Code Here

Examples of org.jboss.netty.buffer.ChannelBuffer.readInt()

      if(Events.NETWORK_MESSAGE == event.getType())
      {
        ChannelBuffer apocalypse = (ChannelBuffer) event.getSource();
        if(apocalypse.readableBytes()>=4)
        {
          int cmd = apocalypse.readInt();
          ZombieCommands command = ZombieCommands.CommandsEnum.fromInt(cmd);
          if(command == ZombieCommands.APOCALYPSE)
          {
            System.out.println("Cancelling " + type +  " timer due to apocalypse");
            service.shutdown();
View Full Code Here

Examples of org.jboss.netty.buffer.ChannelBufferInputStream.readInt()

    ChannelBufferInputStream inputStream = new ChannelBufferInputStream(buffer);
    int senderId = -1;
    long requestId = -1;
    int response = -1;
    try {
      senderId = inputStream.readInt();
      requestId = inputStream.readLong();
      response = inputStream.readByte();
      inputStream.close();
    } catch (IOException e) {
      throw new IllegalStateException(
View Full Code Here

Examples of org.jboss.netty.buffer.DynamicChannelBuffer.readInt()

    int count = 5000000;
    for (int i = 0; i < count; i++) {

      buf.markReaderIndex();
      // read the size of the message
      buf.readInt();
      DefaultMessageTree result = (DefaultMessageTree) codec.decode(buf);
      buf.resetReaderIndex();
      result.setBuffer(buf);
    }
  }
View Full Code Here

Examples of org.jboss.soa.esb.message.body.content.BytesBody.readInt()

    mapMessage.flush();
   
    mapMessage.readMode();

    assertEquals(mapMessage.readInt(), 12345);
    assertEquals(mapMessage.readUTFString(), "hello world");
    assertEquals(mapMessage.readShort(), (short) 10);
    assertEquals(mapMessage.readBoolean(), true);
  }
}
View Full Code Here

Examples of org.jf.dexlib2.dexbacked.BaseDexBuffer.readInt()

    }


    public static int getEndian(byte[] buf, int offset) {
        BaseDexBuffer bdb = new BaseDexBuffer(buf);
        return bdb.readInt(offset + ENDIAN_TAG_OFFSET);
    }
}
View Full Code Here

Examples of org.jgroups.util.ByteArrayDataInputStream.readInt()

        int[] numbers={Integer.MIN_VALUE, -322649, -500, 0, 1, 100, 322649, Integer.MAX_VALUE};
        for(int i: numbers)
            out.writeInt(i);
        ByteArrayDataInputStream in=new ByteArrayDataInputStream(out.buffer());
        for(int i: numbers) {
            int num=in.readInt();
            assert num == i;
        }
    }

    public void testLong() throws IOException {
View Full Code Here

Examples of org.lealone.store.Data.readInt()

                listIndex = 0;
                Data buff = rowBuff;
                buff.reset();
                int min = Constants.FILE_BLOCK_SIZE;
                file.readFully(buff.getBytes(), 0, min);
                int len = buff.readInt() * Constants.FILE_BLOCK_SIZE;
                buff.checkCapacity(len);
                if (len - min > 0) {
                    file.readFully(buff.getBytes(), min, len - min);
                }
                while (true) {
View Full Code Here

Examples of org.lealone.value.Transfer.readInt()

                    for (int j = 0; j < size; j++)
                        transfer.writeString(batchCommands.get(j));
                    session.done(transfer);

                    for (int j = 0; j < size; j++)
                        result[j] = transfer.readInt();
                } else {
                    session.traceOperation("COMMAND_EXECUTE_BATCH_UPDATE_PREPAREDSTATEMENT", id);
                    transfer.writeInt(SessionRemote.COMMAND_EXECUTE_BATCH_UPDATE_PREPAREDSTATEMENT).writeInt(id);
                    int size = batchParameters.size();
                    result = new int[size];
View Full Code Here

Examples of org.lilyproject.bytes.api.DataInput.readInt()

        Assert.assertEquals(b, dataInput.readBoolean());
        Assert.assertEquals(bytes[0], dataInput.readByte());
        Assert.assertArrayEquals(bytes, dataInput.readBytes(10));
        Assert.assertEquals(d, dataInput.readDouble(), 0.0001);
        Assert.assertEquals(f, dataInput.readFloat(), 0.0001);
        Assert.assertEquals(i, dataInput.readInt());
        Assert.assertEquals(l, dataInput.readLong());
        Assert.assertEquals(s, dataInput.readShort());
        Assert.assertEquals(string, dataInput.readUTF());
        Assert.assertEquals(Math.abs(i), dataInput.readVInt());
        Assert.assertEquals(Math.abs(l), dataInput.readVLong());
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.