Package org.jboss.netty.buffer

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


    }

    // Decode the request
    ChannelBuffer buffer = (ChannelBuffer) msg;
    ChannelBufferInputStream inputStream = new ChannelBufferInputStream(buffer);
    int enumValue = inputStream.readByte();
    RequestType type = RequestType.values()[enumValue];
    Class<? extends WritableRequest> writableRequestClass =
        type.getRequestClass();

    WritableRequest writableRequest =
View Full Code Here

    //
    // 1. Convert message to a stream that can be decoded.
    ChannelBuffer buffer = (ChannelBuffer) msg;
    ChannelBufferInputStream inputStream = new ChannelBufferInputStream(buffer);
    // 2. Get first byte: message type:
    int enumValue = inputStream.readByte();
    RequestType type = RequestType.values()[enumValue];
    if (LOG.isDebugEnabled()) {
      LOG.debug("decode: Got a response of type " + type + " from server:" +
        channel.getRemoteAddress());
    }
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.