code: public long[] toLongArray() {
      long[] answer = new long[bitmap.limit()];
      bitmap.rewind();
      bitmap.get(answer);
      return answer;
    }
docs: Create a copy of the content of this container as a long array. This creates a copy.
  
  @return copy of the content as a long array