code: public int read(int index, byte[] dst) {
          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;
              
              // read data into byte array
              if (len > 0) {
                  len = Math.min(len, dst.length);
                  seg.read(segPos + 4, dst, 0, len);
              }
              
              return len;
          } catch(Exception e) {
              _log.warn(e.getMessage());
              return -1;
          }
      }
docs: Reads data bytes at an index into a byte array.
  
  This method does a full read of data bytes only if the destination byte
  array has enough capacity to store all the bytes from the specified index.
  Otherwise, a partial read is done to fill in the destination byte array.
  
  @param index  the array index
  @param dst    the byte array to fill in
  @return the total number of bytes read if data is available at the given index.
  Otherwise, <code>-1</code>.