Package com.dianping.cat.message.spi.codec

Examples of com.dianping.cat.message.spi.codec.PlainTextMessageCodec.reset()


    PlainTextMessageCodec codec = new PlainTextMessageCodec();
    ChannelBuffer buf = ChannelBuffers.dynamicBuffer(8192);

    codec.encode(this, buf);
    buf.readInt(); // get rid of length
    codec.reset();
    return buf.toString(Charset.forName("utf-8"));
  }
}
View Full Code Here


  public String toString() {
    PlainTextMessageCodec codec = new PlainTextMessageCodec();
    ChannelBuffer buf = ChannelBuffers.dynamicBuffer();

    codec.encodeMessage(this, buf);
    codec.reset();
    return buf.toString(Charset.forName("utf-8"));
  }
}
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.