} else if (output instanceof UnsafeMemoryOutput) {
UnsafeMemoryOutput unsafeOutput = (UnsafeMemoryOutput)output;
unsafeOutput.writeBytes(object, offset, len);
} else {
long off;
Unsafe unsafe = unsafe();
for (off = offset; off < offset + len - 8; off += 8) {
output.writeLong(unsafe.getLong(object, off));
}
if (off < offset + len) {
for (; off < offset + len; ++off) {
output.write(unsafe.getByte(object, off));
}
}
}
}