Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static ChannelBuffer getData(boolean worldConfiguration, boolean worldStatus) {
- ChannelBuffer buffer = ChannelBuffers.buffer(1024);
- buffer.writeByte(worldConfiguration ? 1 : 0);
- buffer.writeByte(worldStatus ? 1 : 0);
- if (worldConfiguration) {
- populateConfiguration(buffer);
- }
- if (worldStatus) {
- populateStatus(buffer);
- }
- ChannelBuffer finalBuffer = ChannelBuffers.buffer(buffer.capacity() + 3);
- finalBuffer.writeByte((byte) 0);
- finalBuffer.writeShort((short) buffer.capacity());
- finalBuffer.writeBytes(buffer);
- return finalBuffer;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement