Advertisement
Tyluur

Untitled

Jul 2nd, 2012
39
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. public static ChannelBuffer getData(boolean worldConfiguration, boolean worldStatus) {
  2. ChannelBuffer bldr = ChannelBuffers.dynamicBuffer();
  3. bldr.writeByte(worldConfiguration ? 1 : 0);
  4. bldr.writeByte(worldStatus ? 1 : 0);
  5. if (worldConfiguration) {
  6. populateConfiguration(bldr);
  7. }
  8. if (worldStatus) {
  9. populateStatus(bldr);
  10. }
  11. ChannelBuffer finalBuffer = ChannelBuffers.buffer(bldr.capacity() + 3);
  12. finalBuffer.writeByte((byte) 0);
  13. finalBuffer.writeShort((short) bldr.capacity());
  14. finalBuffer.writeBytes(bldr);
  15. return finalBuffer;
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement