private int makeAvailable() throws IOException {
  if (pos != -1) {
    return 0;
  }
  total+=tail - head - pad;
  System.arraycopy(buffer,tail - pad,buffer,0,pad);
  head=0;
  tail=pad;
  for (; ; ) {
    int bytesRead=input.read(buffer,tail,bufSize - tail);
    if (bytesRead == -1) {
      final String msg="Stream ended unexpectedly";
      throw new MalformedStreamException(msg);
    }
    tail+=bytesRead;
    findSeparator();
    int av=available();
    if (av > 0 || pos != -1) {
      return av;
    }
  }
}

private int makeAvailable ( ) throws IOException { if ( pos != - 1 ) { return 0 ; } total += tail - head - pad ; System . arraycopy ( buffer , tail - pad , buffer , 0 , pad ) ; head = 0 ; tail = pad ; for ( ; ; ) { int bytesRead = input . read ( buffer , tail , bufSize - tail ) ; if ( bytesRead == - 1 ) { final String msg = "Stream ended unexpectedly" ; throw new MalformedStreamException ( msg ) ; } tail += bytesRead ; findSeparator ( ) ; int av = available ( ) ; if ( av > 0 || pos != - 1 ) { return av ; } } }
attempts to read more data .
