public static java.util.List computeFragOffsets(byte[] buf, int frag_size) { return computeFragOffsets(0, buf.length, frag_size);
public static java.util.List computeFragOffsets(int offset, int length, int frag_size) { java.util.List   retval=new ArrayList(); long   total_size=length + offset; int    index=offset; int    tmp_size=0; Range  r;  while(index < total_size) { if(index + frag_size <= total_size) tmp_size=frag_size; else tmp_size=(int)(total_size - index); r=new Range(index, tmp_size); retval.add(r); index+=tmp_size; } return retval;
    public static java.util.List computeFragOffsets(byte[] buf, int frag_size) {        return computeFragOffsets(0, buf.length, frag_size);    }