Advertisement
Tyluur

Untitled

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