tmpEntry.writeInt(totalHeaderSize - 4);
tmpEntry.writeInt(new PacketHeader(BookieProtocol.CURRENT_PROTOCOL_VERSION,
BookieProtocol.READENTRY,
BookieProtocol.FLAG_DO_FENCING).toInt());
tmpEntry.writeLong(ledgerId);
tmpEntry.writeLong(entryId);
tmpEntry.writeBytes(masterKey, 0, BookieProtocol.MASTER_KEY_LENGTH);
ChannelFuture future = channel.write(tmpEntry);
future.addListener(new ChannelFutureListener() {