/** * Transfers bytes from the given source array into this buffer array * @param start start offset of this buffer array * @param len The maximum number of bytes to be read from the given array * @param srcArray The array from which bytes are to be read */ public void putMultiple(long start, int len, byte[] srcArray) { putMultiple(start, len, srcArray, 0); }
/** * Transfers data from the given byte buffer to file * @param srcBuffer the given byte buffer from which bytes are to be read * @param offset The offset in the file where the first byte to be written * @throws IOException */ @Override public void write(ByteBuffer srcBuffer, long offset) throws IOException { assert srcBuffer.hasArray(); bufferArray.putMultiple(offset, srcBuffer.remaining(), srcBuffer.array(), srcBuffer.arrayOffset()); }
/** * Transfers data from the given byte buffer to the buffer array * @param srcBuffer the given byte buffer from which bytes are to be read * @param offset The offset in the ByteBufferArray of the first byte to be * written * @throws IOException throws IOException if writing to the array throws exception */ @Override public void write(ByteBuffer srcBuffer, long offset) throws IOException { assert srcBuffer.hasArray(); bufferArray.putMultiple(offset, srcBuffer.remaining(), srcBuffer.array(), srcBuffer.arrayOffset()); }
@Override public void write(ByteBuff srcBuffer, long offset) throws IOException { // This singleByteBuff can be considered to be array backed assert srcBuffer.hasArray(); bufferArray.putMultiple(offset, srcBuffer.remaining(), srcBuffer.array(), srcBuffer.arrayOffset()); } /**
@Override public void write(ByteBuff srcBuffer, long offset) throws IOException { // When caching block into BucketCache there will be single buffer backing for this HFileBlock. // This will work for now. But from the DFS itself if we get DBB then this may not hold true. assert srcBuffer.hasArray(); bufferArray.putMultiple(offset, srcBuffer.remaining(), srcBuffer.array(), srcBuffer.arrayOffset()); } /**
/** * Transfers bytes from the given source array into this buffer array * @param start start offset of this buffer array * @param len The maximum number of bytes to be read from the given array * @param srcArray The array from which bytes are to be read */ public void putMultiple(long start, int len, byte[] srcArray) { putMultiple(start, len, srcArray, 0); }
/** * Transfers bytes from the given source array into this buffer array * @param start start offset of this buffer array * @param len The maximum number of bytes to be read from the given array * @param srcArray The array from which bytes are to be read */ public void putMultiple(long start, int len, byte[] srcArray) { putMultiple(start, len, srcArray, 0); }
/** * Transfers bytes from the given source array into this buffer array * @param start start offset of this buffer array * @param len The maximum number of bytes to be read from the given array * @param srcArray The array from which bytes are to be read */ public void putMultiple(long start, int len, byte[] srcArray) { putMultiple(start, len, srcArray, 0); }
/** * Transfers data from the given byte buffer to the buffer array * @param srcBuffer the given byte buffer from which bytes are to be read * @param offset The offset in the ByteBufferArray of the first byte to be * written * @throws IOException */ @Override public void write(ByteBuffer srcBuffer, long offset) throws IOException { assert srcBuffer.hasArray(); bufferArray.putMultiple(offset, srcBuffer.remaining(), srcBuffer.array(), srcBuffer.arrayOffset()); }