Buffer buffer = packet.getContent();
int writeCount = 0;
if (packet.getAddress() == null) // connected
writeCount = buffer.write(channel);
else {
writeCount = channel.send(buffer.asByteBuffer(), packet
.getAddress());
buffer.skip(writeCount);
}
return writeCount != 0;
}