code: @Override
      public int transferTo(int index, WritableByteChannel channel) {
          rangeCheck(index);
          
          try {
              long address = getAddress(index);
              int segPos = _addressFormat.getOffset(address);
              int segInd = _addressFormat.getSegment(address);
              
              // no data found
              if(segPos < Segment.dataStartPosition) return -1;
              
              // get data segment
              Segment seg = _segmentManager.getSegment(segInd);
              if(seg == null) return -1;
              
              // read data length
              int size = _addressFormat.getDataSize(address);
              int len = (size == 0) ? seg.readInt(segPos) : size;
              
              // transfer data to a writable channel
              if (len > 0) {
                  seg.transferTo(segPos + 4, len, channel);
              }
              
              return len;
          } catch(Exception e) {
              return -1;
          }
      }
docs: Transfers data at a given index to a writable channel.
  
  @param index  the array index
  @return the amount of bytes transferred (the length of data at the given index).
  @throws ArrayIndexOutOfBoundsException if the index is out of range.