code: int available(Context context) {  // package protected for access from I/O streams
          return context.buffer != null ? context.pos - context.readPos : 0;
      }
docs: Returns the amount of buffered data available for reading.
  
  @param context the context to be used
  @return The amount of buffered data available for reading.