public synchronized int available() throws IOException { if (in < 0) return 0;  if (in > out) return in - out;   return buffer.length - out + in; }
available() throws IOException { if (in == -1) return(0); else if (in > out) return(in - out); else return(in + (pipe_size - out)); }
  public synchronized int available() throws IOException  {    if (in < 0)      return 0;    if (in > out)      return in - out;    // Buffer has wrapped around.    return buffer.length - out + in;  }