Refine search
public void putZeroTerminatedByteArray(long offset, byte[] bytes, int off, int len) { // Ensure room for terminating zero byte checkBounds(offset, len + 1); System.arraycopy(bytes, off, buffer, index(offset), len); buffer[len] = (byte) 0; }
public final byte[] getZeroTerminatedByteArray(long offset) { checkBounds(offset, 1); int len = indexOf(offset, (byte) 0); byte[] bytes = new byte[len != -1 ? len : length - (int) offset]; System.arraycopy(buffer, index(offset), bytes, 0, bytes.length); return bytes; }
public void putZeroTerminatedByteArray(long offset, byte[] bytes, int off, int len) { // Ensure room for terminating zero byte checkBounds(offset, len + 1); System.arraycopy(bytes, off, buffer, index(offset), len); buffer[len] = (byte) 0; }
public final byte[] getZeroTerminatedByteArray(long offset) { checkBounds(offset, 1); int len = indexOf(offset, (byte) 0); byte[] bytes = new byte[len != -1 ? len : length - (int) offset]; System.arraycopy(buffer, index(offset), bytes, 0, bytes.length); return bytes; }
public void putZeroTerminatedByteArray(long offset, byte[] bytes, int off, int len) { // Ensure room for terminating zero byte checkBounds(offset, len + 1); System.arraycopy(bytes, off, buffer, index(offset), len); buffer[len] = (byte) 0; }
public final byte[] getZeroTerminatedByteArray(long offset) { checkBounds(offset, 1); int len = indexOf(offset, (byte) 0); byte[] bytes = new byte[len != -1 ? len : length - (int) offset]; System.arraycopy(buffer, index(offset), bytes, 0, bytes.length); return bytes; }
public final void putAddress(long offset, long value) { checkBounds(offset, ADDRESS_SIZE >> 3); IO.putAddress(buffer, index(offset), value); } public final void get(long offset, byte[] dst, int off, int len) {
public final byte[] getZeroTerminatedByteArray(long offset, int maxlen) { checkBounds(offset, 1); int len = indexOf(offset, (byte) 0, maxlen); byte[] bytes = new byte[len != -1 ? len : Math.min(length - (int) offset, maxlen)]; System.arraycopy(buffer, index(offset), bytes, 0, bytes.length); return bytes; }
public final void get(long offset, short[] dst, int off, int len) { checkBounds(offset, len << 1); int begin = index(offset); for (int i = 0; i < len; ++i) { dst[off + i] = IO.getInt16(buffer, begin + (i << 1)); } }
public final byte[] getZeroTerminatedByteArray(long offset, int maxlen) { checkBounds(offset, 1); int len = indexOf(offset, (byte) 0, maxlen); byte[] bytes = new byte[len != -1 ? len : Math.min(length - (int) offset, maxlen)]; System.arraycopy(buffer, index(offset), bytes, 0, bytes.length); return bytes; }
public final void put(long offset, long[] src, int off, int len) { checkBounds(offset, len << 3); int begin = index(offset); for (int i = 0; i < len; ++i) { IO.putInt64(buffer, begin + (i << 3), src[off + i]); } }
public final byte[] getZeroTerminatedByteArray(long offset, int maxlen) { checkBounds(offset, 1); int len = indexOf(offset, (byte) 0, maxlen); byte[] bytes = new byte[len != -1 ? len : Math.min(length - (int) offset, maxlen)]; System.arraycopy(buffer, index(offset), bytes, 0, bytes.length); return bytes; }
public final void get(long offset, float[] dst, int off, int len) { checkBounds(offset, len << 2); int begin = index(offset); for (int i = 0; i < len; ++i) { dst[off + i] = IO.getFloat32(buffer, begin + (i << 2)); } }
public final void put(long offset, float[] src, int off, int len) { checkBounds(offset, len << 2); int begin = index(offset); for (int i = 0; i < len; ++i) { IO.putFloat32(buffer, begin + (i << 2), src[off + i]); } }
public final void put(long offset, short[] src, int off, int len) { checkBounds(offset, len << 1); int begin = index(offset); for (int i = 0; i < len; ++i) { IO.putInt16(buffer, begin + (i << 1), src[off + i]); } }
public final void get(long offset, double[] dst, int off, int len) { checkBounds(offset, len << 3); int begin = index(offset); for (int i = 0; i < len; ++i) { dst[off + i] = IO.getFloat64(buffer, begin + (i << 3)); } }
public final void get(long offset, int[] dst, int off, int len) { checkBounds(offset, len << 2); int begin = index(offset); for (int i = 0; i < len; ++i) { dst[off + i] = IO.getInt32(buffer, begin + (i << 2)); } }
public final void put(long offset, int[] src, int off, int len) { checkBounds(offset, len << 2); int begin = index(offset); for (int i = 0; i < len; ++i) { IO.putInt32(buffer, begin + (i << 2), src[off + i]); } }
public final void get(long offset, long[] dst, int off, int len) { checkBounds(offset, len << 3); int begin = index(offset); for (int i = 0; i < len; ++i) { dst[off + i] = IO.getInt64(buffer, begin + (i << 3)); } }
public final void put(long offset, double[] src, int off, int len) { checkBounds(offset, len << 3); int begin = index(offset); for (int i = 0; i < len; ++i) { IO.putFloat64(buffer, begin + (i << 3), src[off + i]); } }