Examples of readableBytes()


Examples of net.minecraft.network.PacketBuffer.readableBytes()

                            {
                                commandblocklogic = ((EntityMinecartCommandBlock)entity).func_145822_e();
                            }
                        }

                        String s1 = packetbuffer.readStringFromBuffer(packetbuffer.readableBytes());

                        if (commandblocklogic != null)
                        {
                            commandblocklogic.func_145752_a(s1);
                            commandblocklogic.func_145756_e();
View Full Code Here

Examples of net.minecraft.util.io.netty.buffer.ByteBuf.readableBytes()

        } else if (segment.startsWith("base64,")) {
          byte[] encoded = segment.substring(7).getBytes(Charsets.UTF_8);
          ByteBuf decoded = Base64.decode(Unpooled.wrappedBuffer(encoded));
         
          // Read into a byte array
          byte[] data = new byte[decoded.readableBytes()];
          decoded.readBytes(data);
          this.data = data;
        } else {
          // We will ignore these segments
        }
View Full Code Here

Examples of org.apache.directmemory.memory.buffer.MemoryBuffer.readableBytes()

        pointer.hit();

        final MemoryBuffer buf = pointer.getMemoryBuffer();
        buf.readerIndex( 0 );

        final byte[] swp = new byte[(int) buf.readableBytes()];
        buf.readBytes( swp );
        return swp;
    }

    @Override
View Full Code Here

Examples of org.arch.buffer.Buffer.readableBytes()

    byte[] raw = content.getRawBuffer();
    switch (type)
    {
      case NONE:
      {
        BufferHelper.writeVarInt(outbuf, content.readableBytes());
        outbuf.write(raw,content.getReadIndex(), content.readableBytes());
        break;
      }
      case QUICKLZ:
      {
View Full Code Here

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

        message.writeTo(output);
        output.checkNoSpaceLeft();

        buffer.writerIndex(writerIndex + size);
        Adler32 checksum = new Adler32();
        checksum.update(buffer.array(), buffer.arrayOffset(), buffer.readableBytes());
        buffer.writeInt((int) checksum.getValue());
        return buffer;
    }
}
View Full Code Here

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

                    this.fragmentOpcode = null;
                    frames.clear();
                }

                if (this.opcode == OPCODE_TEXT) {
                    if (frame.readableBytes() > MAX_LENGTH) {
                        throw new TooLongFrameException();
                    }
                    return new DefaultWebSocketFrame(0x00, frame);
                } else if (this.opcode == OPCODE_BINARY) {
                    return new DefaultWebSocketFrame(0xFF, frame);
View Full Code Here

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

  }

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

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

          _currentToken = _tokens.get(new ByteArrayWrapper(_receivedBytes));
          if (_currentToken != null && (_uniqueLogon || _currentToken.isLoggedOn()))
          {
            logger.info("authenticated");
            ((SimpleAuthToken)_currentToken).setLoggedOn(true);
            if (b.readableBytes() != 0)
              ctx.sendUpstream(e);
            return PASSED;
          }
          else
          {
View Full Code Here

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

   * @see org.rzo.netty.ahessian.auth.AuthToken#authenticate(org.jboss.netty.channel.ChannelHandlerContext, org.jboss.netty.channel.MessageEvent)
   */
  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 == _password.length)
View Full Code Here

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

      if (_receivedLength == _password.length)
      {
        if (Arrays.equals(_receivedBytes, _password))
        {
          logger.info("authenticated");
          if (b.readableBytes() != 0)
            ctx.sendUpstream(e);
          return PASSED;
        }
        else
          return FAILED;
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.