code: public byte[] getBytesAt(int index,int size){ 
          _checkForReadAt(index,size);
         byte[] dst = new byte[size];
         int i=0;
         int j=index;
         while (i<size) {
             dst[i++] =  _buf.get(j++);
         }
         return dst;
      }
docs: Returns a byte array of length size from the buffer starting from the specified position.
  @param index the index
  @param size the size of the buffer to be returned
  @return a new byte array with bytes read from the buffer