/** * Transfers bytes from this buffer array into the given destination array * @param start start position in the ByteBufferArray * @param len The maximum number of bytes to be written to the given array * @param dstArray The array into which bytes are to be written * @return number of bytes read */ public int getMultiple(long start, int len, byte[] dstArray) { return getMultiple(start, len, dstArray, 0); }
@Override public Cacheable read(long offset, int length, CacheableDeserializer<Cacheable> deserializer) throws IOException { byte[] dst = new byte[length]; bufferArray.getMultiple(offset, length, dst); return deserializer.deserialize(new SingleByteBuff(ByteBuffer.wrap(dst)), true, MemoryType.EXCLUSIVE); }
/** * Transfers bytes from this buffer array into the given destination array * @param start start position in the ByteBufferArray * @param len The maximum number of bytes to be written to the given array * @param dstArray The array into which bytes are to be written * @return number of bytes read */ public int getMultiple(long start, int len, byte[] dstArray) { return getMultiple(start, len, dstArray, 0); }
/** * Transfers bytes from this buffer array into the given destination array * @param start start position in the ByteBufferArray * @param len The maximum number of bytes to be written to the given array * @param dstArray The array into which bytes are to be written * @return number of bytes read */ public int getMultiple(long start, int len, byte[] dstArray) { return getMultiple(start, len, dstArray, 0); }
/** * Transfers bytes from this buffer array into the given destination array * @param start start position in the ByteBufferArray * @param len The maximum number of bytes to be written to the given array * @param dstArray The array into which bytes are to be written * @return number of bytes read */ public int getMultiple(long start, int len, byte[] dstArray) { return getMultiple(start, len, dstArray, 0); }
/** * Transfers data from the buffer array to the given byte buffer * @param dstBuffer the given byte buffer into which bytes are to be written * @param offset The offset in the ByteBufferArray of the first byte to be * read * @return number of bytes read * @throws IOException */ @Override public int read(ByteBuffer dstBuffer, long offset) throws IOException { assert dstBuffer.hasArray(); return bufferArray.getMultiple(offset, dstBuffer.remaining(), dstBuffer.array(), dstBuffer.arrayOffset()); }