Package io.netty.buffer

Examples of io.netty.buffer.ByteBufInputStream


    return "InboundRpcMessage [pBody=" + pBody + ", mode=" + mode + ", rpcType=" + rpcType + ", coordinationId="
        + coordinationId + ", dBody=" + dBody + "]";
  }
 
  public InputStream getProtobufBodyAsIS(){
    return new ByteBufInputStream(pBody);
  }
View Full Code Here


            int dataLength = in.readInt();
            if (in.readableBytes() < dataLength) {
                in.resetReaderIndex();
                return;
            }
            ml.add( server.decode( new ByteBufInputStream(in), dataLength) );
        }
    }
View Full Code Here

    public static String[] decode(final TextWebSocketFrame frame) throws IOException {
        final ByteBuf content = frame.content();
        if (content.readableBytes() == 0) {
            return EMPTY_STRING_ARRAY;
        }
        final ByteBufInputStream byteBufInputStream = new ByteBufInputStream(content);
        final byte firstByte = content.getByte(0);
        if (firstByte == '[') {
            return MAPPER.readValue(byteBufInputStream, String[].class);
        } else if (firstByte == '{') {
            return new String[] { content.toString(CharsetUtil.UTF_8) };
View Full Code Here

      }

      // Skip written length
      buffer.skipBytes(4);

      return new ByteBufInputStream(buffer) {
        @Override
        public void close() throws IOException {
          super.close();
          buffer.release();
        }
View Full Code Here

      }

      final ByteBuf data = buffer.readBytes(readLength);
      buffer.skipBytes(length - readLength);

      return new ByteBufInputStream(data) {
        @Override
        public void close() throws IOException {
          super.close();
          data.release();
        }
View Full Code Here

        if (frame == null) {
            return null;
        }

        return new CompactObjectInputStream(
                new ByteBufInputStream(frame), classResolver).readObject();
    }
View Full Code Here

       * @param cause
       */
      @Override
      public void channelRead(ChannelHandlerContext ctx, Object msg) {
        ByteBuf byteBuf = (ByteBuf) msg;
        ByteBufInputStream byteBufInputStream = new ByteBufInputStream(byteBuf);
        DataInputStream in = new DataInputStream(byteBufInputStream);
        while (true) {
          try {
            if (in.available() <= 0)
              break;
View Full Code Here

                if (stream.readableBytes() > 4)
                {
                    // If the packet wasn't empty, add the new biomes
                    WorldClient worldMC = FMLClientHandler.instance().getClient().theWorld;

                    DataInputStream wrappedStream = new DataInputStream(new ByteBufInputStream(stream));
                    String worldName = ConfigFile.readStringFromStream(wrappedStream);
                    ForgeWorld worldTC = new ForgeWorld(worldName);
                    WorldSettings config = new WorldSettings(wrappedStream, worldTC);
                    wrappedStream.close();
View Full Code Here

            return false;
        }

        @Override
        protected InputStream getInputStream() throws IOException {
            return new ByteBufInputStream(getHttpResponseContent().content());
        }
View Full Code Here

  Netty4ClientHttpResponse(ChannelHandlerContext context, FullHttpResponse nettyResponse) {
    Assert.notNull(context, "'context' must not be null");
    Assert.notNull(nettyResponse, "'nettyResponse' must not be null");
    this.context = context;
    this.nettyResponse = nettyResponse;
    this.body = new ByteBufInputStream(this.nettyResponse.content());
    this.nettyResponse.retain();
  }
View Full Code Here

TOP

Related Classes of io.netty.buffer.ByteBufInputStream

Copyright © 2018 www.massapicom. 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.