Examples of readBytes()


Examples of org.hornetq.core.client.impl.LargeMessageControllerImpl.readBytes()

      final LargeMessageControllerImpl buffer = new LargeMessageControllerImpl(new FakeConsumerInternal(), 10, 10);

      buffer.addPacket(new FakePacket(-1, new byte[] { 0, 1, 2, 3, 4 }, true, true));

      byte bytes[] = new byte[30];
      buffer.readBytes(bytes, 0, 5);

      for (byte i = 0; i < 5; i++)
      {
         Assert.assertEquals(i, bytes[i]);
      }
View Full Code Here

Examples of org.hornetq.jms.client.HornetQStreamMessage.readBytes()

      message.writeBytes(value);
      message.reset();

      byte[] v = new byte[value.length];
      message.readBytes(v);

      UnitTestCase.assertEqualsByteArrays(value, v);
   }

   public void testReadBytesFromBytes_2() throws Exception
View Full Code Here

Examples of org.iq80.leveldb.util.SliceInput.readBytes()

            else {
                type = LogChunkType.MIDDLE;
            }

            // write the chunk
            writeChunk(type, sliceInput.readBytes(fragmentLength));

            // we are no longer on the first chunk
            begin = false;
        } while (sliceInput.isReadable());
View Full Code Here

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

  public int authenticate(ChannelHandlerContext ctx, MessageEvent e)
  {
        ChannelBuffer b = (ChannelBuffer) e.getMessage();
        int toCopy = Math.min(_receivedBytes.length-_receivedLength, b.readableBytes());
        byte[] bytes = new byte[toCopy];
        b.readBytes(bytes);
        System.arraycopy(bytes, 0, _receivedBytes, _receivedLength, bytes.length);
        _receivedLength += toCopy;
        if (_receivedLength == _receivedBytes.length)
        {
          _currentToken = _tokens.get(new ByteArrayWrapper(_receivedBytes));
View Full Code Here

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

                done(transfer);
                length = transfer.readInt();
                if (length <= 0) {
                    return length;
                }
                transfer.readBytes(buff, off, length);
                return length;
            } catch (IOException e) {
                removeServer(e, i--, ++count);
            }
        }
View Full Code Here

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

        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());
        Assert.assertEquals(s, dataInput.readShort());
View Full Code Here

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

        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());
        Assert.assertEquals(s, dataInput.readShort());
View Full Code Here

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

      byte[] password = null;

      int lenU = p.readInt();
      username = p.readString(lenU).trim();
      int len = p.readInt();
      password = new Hash(p.readBytes(len)).value();

      if (world.countPlayers() >= Config.MAX_PLAYERS) {
        loginCode = 10;
      } else if (clientVersion < Config.SERVER_VERSION) {
        loginCode = 4;
View Full Code Here

Examples of org.netbeans.lib.cvsclient.util.LoggedDataInputStream.readBytes()

            }

            // read first 11 bytes only (AUTHENTICATION_SUCCEEDED_RESPONSE\n)
            // I observed lock caused by missing '\n' in reponse
            // this method then blocks forever
            byte rawResponse[] = inputStream.readBytes(AUTHENTICATION_SUCCEEDED_RESPONSE_RAW.length());
            String response = new String(rawResponse, "utf8")// NOI18N

            if (Thread.interrupted()) {
                reset();
                String localMsg = CommandException.getLocalMessage("Client.connectionAborted", null); //NOI18N
View Full Code Here

Examples of org.quickserver.net.client.BlockingClient.readBytes()

     
      client.connect(socketBasedHost.getInetAddress().getHostAddress(),
          socketBasedHost.getInetSocketAddress().getPort());
     
      if(socketBasedHost.getTextToExpect()!=null) {
        String textGot = client.readBytes();
        if(textGot.indexOf(socketBasedHost.getTextToExpect())!=-1) {
          return Host.ACTIVE;
        } else {
          logger.fine(socketBasedHost+" Error: Text ["+socketBasedHost.getTextToExpect()
              +"]Not found! Got: "+textGot);
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.