common/src/main/java/HTTPClient/BufferedInputStream.java
/**
     * Figures out how many bytes past the end of the multipart we read. If we
     * found the end, it then resets the read pos to just past the end of the
     * boundary and unsets the mark; if not found, is sets the mark_pos back
     * enough from the current position so we can always be sure to find the
     * boundary.
     *
     * @param search     the search string (end boundary)
     * @param search_cmp the compiled info of the search string
     * @return how many bytes past the end of the boundary we went; -1 if we
     *         haven't gone passed it yet.
     */
Figures out how many bytes past the end of the multipart we read. If we
found the end, it then resets the read pos to just past the end of the
boundary and unsets the mark; if not found, is sets the mark_pos back
enough from the current position so we can always be sure to find the
boundary.

@param search     the search string (end boundary)
@param search_cmp the compiled info of the search string
@return how many bytes past the end of the boundary we went; -1 if we
haven't gone passed it yet.
Figures out how many bytes past the end of the multipart we read . If we found the end it then resets the read pos to just past the end of the boundary and unsets the mark ; if not found is sets the mark_pos back enough from the current position so we can always be sure to find the boundary . @param search the search string ( end boundary ) @param search_cmp the compiled info of the search string @return how many bytes past the end of the boundary we went ; - 1 if we haven ' t gone passed it yet .
int pastEnd(byte[] search, int[] search_cmp)
    {
	int idx = Util.findStr(search, search_cmp, buffer, mark_pos, pos);
	if (idx == -1)
	    mark_pos = (pos > search.length) ? pos - search.length : 0;
	else
	{
	    int eos  = idx + search.length;
	    idx      = pos - eos;
	    pos      = eos;
	    mark_pos = -1;
	}
	return idx;
    }
int pastEnd ( byte [ ] search , int [ ] search_cmp ) { int idx = Util . findStr ( search , search_cmp , buffer , mark_pos , pos ) ; if ( idx == - 1 ) mark_pos = ( pos > search . length ) ? pos - search . length : 0 ; else { int eos = idx + search . length ; idx = pos - eos ; pos = eos ; mark_pos = - 1 ; } return idx ; }
Figures out how many bytes past the end of the multipart we read.
Figures out how many bytes past the end of the multipart we read .