private final static void copyLong(byte[] buffer, int inputIndex, int outputIndex, int length, int outputEnd8) { if ((outputIndex + length) > outputEnd8) { copyLongTail(buffer, inputIndex,outputIndex, length); return; } long inPtr = BYTE_ARRAY_OFFSET + inputIndex; long outPtr = BYTE_ARRAY_OFFSET + outputIndex; while (length >= 8) { unsafe.putLong(buffer, outPtr, unsafe.getLong(buffer, inPtr)); inPtr += 8; outPtr += 8; length -= 8; } if (length > 4) { unsafe.putLong(buffer, outPtr, unsafe.getLong(buffer, inPtr)); } else if (length > 0) { unsafe.putInt(buffer, outPtr, unsafe.getInt(buffer, inPtr)); } }
private final static void copyLong(byte[] buffer, int inputIndex, int outputIndex, int length, int outputEnd8) { if ((outputIndex + length) > outputEnd8) { copyLongTail(buffer, inputIndex,outputIndex, length); return; } long inPtr = BYTE_ARRAY_OFFSET + inputIndex; long outPtr = BYTE_ARRAY_OFFSET + outputIndex; while (length >= 8) { unsafe.putLong(buffer, outPtr, unsafe.getLong(buffer, inPtr)); inPtr += 8; outPtr += 8; length -= 8; } if (length > 4) { unsafe.putLong(buffer, outPtr, unsafe.getLong(buffer, inPtr)); } else if (length > 0) { unsafe.putInt(buffer, outPtr, unsafe.getInt(buffer, inPtr)); } }
private final static void copyLong(byte[] buffer, int inputIndex, int outputIndex, int length, int outputEnd8) { if ((outputIndex + length) > outputEnd8) { copyLongTail(buffer, inputIndex,outputIndex, length); return; } long inPtr = BYTE_ARRAY_OFFSET + inputIndex; long outPtr = BYTE_ARRAY_OFFSET + outputIndex; while (length >= 8) { unsafe.putLong(buffer, outPtr, unsafe.getLong(buffer, inPtr)); inPtr += 8; outPtr += 8; length -= 8; } if (length > 4) { unsafe.putLong(buffer, outPtr, unsafe.getLong(buffer, inPtr)); } else if (length > 0) { unsafe.putInt(buffer, outPtr, unsafe.getInt(buffer, inPtr)); } }