// write value if there is one
ChannelBuffer valueBuffer = null;
if (command.elements != null) {
extrasBuffer = ChannelBuffers.buffer(ByteOrder.BIG_ENDIAN, 4);
CacheElement element = command.elements[0];
extrasBuffer.writeShort((short) (element != null ? element.getExpire() : 0));
extrasBuffer.writeShort((short) (element != null ? element.getFlags() : 0));
if ((command.cmd.cmd == Command.GET || command.cmd.cmd == Command.GETS)) {
if (element != null) {
valueBuffer = ChannelBuffers.wrappedBuffer(ByteOrder.BIG_ENDIAN, element.getData());
} else {
valueBuffer = ChannelBuffers.buffer(0);
}
} else if (command.cmd.cmd == Command.INCR || command.cmd.cmd == Command.DECR) {
valueBuffer = ChannelBuffers.buffer(ByteOrder.BIG_ENDIAN, 8);