Examples of readByte()


Examples of org.jboss.marshalling.Unmarshaller.readByte()

            expectHeader(unmarshaller, StandaloneClientProtocol.PARAM_APPLY_UPDATES_RESULT_COUNT);
            final int updateCount = unmarshaller.readInt();
            List<StandaloneUpdateResult<?>> results = new ArrayList<StandaloneUpdateResult<?>>();
            for (int i = 0; i < updateCount; i++) {
                expectHeader(unmarshaller, StandaloneClientProtocol.PARAM_APPLY_UPDATE_RESULT);
                byte resultCode = unmarshaller.readByte();
                if (resultCode == (byte) StandaloneClientProtocol.PARAM_APPLY_UPDATE_RESULT_EXCEPTION) {
                    final UpdateFailedException failure = unmarshal(unmarshaller, UpdateFailedException.class);
                    results.add(new StandaloneUpdateResult<Object>(null, failure));
                } else {
                    final Object result = unmarshal(unmarshaller, Object.class);
View Full Code Here

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

  @Override
  protected Object decode(ChannelHandlerContext ctx, Channel channel, Object message) throws Exception
  {
    ChannelBuffer b = (ChannelBuffer) message;

    byte code = b.readByte();
    // TODO remove the nul
    b.writerIndex(b.writerIndex());
    String msg = b.toString(Charset.defaultCharset().displayName());
    Message result = new Message(code, msg);
    return result;
View Full Code Here

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

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

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

        for(short i=Byte.MIN_VALUE; i <= Byte.MAX_VALUE; i++)
            out.writeByte(i);

        ByteArrayDataInputStream in=new ByteArrayDataInputStream(out.buffer());
        for(short i=Byte.MIN_VALUE; i <= Byte.MAX_VALUE; i++) {
            byte read=in.readByte();
            assert i == read;
        }
    }

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

Examples of org.jmol.util.BinaryDocument.readByte()

        //note -- these headers must match those in ZipUtil.getAllData and CompoundDocument.getAllData
        if (header != null)
          sb.append("BEGIN Directory Entry " + name0 + "\n");
        try {
          while (true)
            sb.append(Integer.toHexString(((int) bd.readByte()) & 0xFF))
                .append(' ');
        } catch (Exception e1) {
          sb.append('\n');
        }
        if (header != null)
View Full Code Here

Examples of org.jnode.driver.bus.smbus.SMBusControler.readByte()

        }

        for (byte i = 0; i < 8; i++) {
            try {
                // TODO - can someone explain why we are shifting and ORing?  It looks like a bug to me.
                byte res = smbusctrl.readByte((byte) (0xa0 | (i << 1)), (byte) 2);
                out.println("DIMM " + i + " : type = " + Integer.toHexString(res));
            } catch (IOException ex) {
                out.println("DIMM " + i + " : not present");
            }
        }
View Full Code Here

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

        dataOutput.writeVLong(Math.abs(l));

        byte[] data = dataOutput.toByteArray();
        DataInput dataInput = new DataInputImpl(data);
        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());
View Full Code Here

Examples of org.lilyproject.bytes.impl.DataInputImpl.readByte()

        dataOutput.writeVLong(Math.abs(l));

        byte[] data = dataOutput.toByteArray();
        DataInput dataInput = new DataInputImpl(data);
        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());
View Full Code Here

Examples of org.moparscape.msc.gs.connection.Packet.readByte()

    try {

      byte[] data = RSA.decrypt(p1.getData());
      Packet p = new Packet(session, data);

      boolean reconnecting = (p.readByte() == 1);

      int clientVersion = p.readInt();

      if (Config.SERVER_VERSION != clientVersion) {
        Logger.println("ip: " + ip + " | clientversion: "
View Full Code Here

Examples of org.msgpack.unpacker.BufferUnpacker.readByte()

  MessagePack msgpack = new MessagePack();
  BufferPacker packer = msgpack.createBufferPacker();
  packer.writeByte(v);
  byte[] bytes = packer.toByteArray();
  BufferUnpacker unpacker = msgpack.createBufferUnpacker(bytes);
  byte ret = unpacker.readByte();
  assertEquals(v, ret);
    }

    @Test @Override
    public void testShort() throws Exception {
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.