code: public static int getAvailable (@Nullable final InputStream aIS)
    {
      if (aIS != null)
        try
        {
          return aIS.available ();
        }
        catch (final IOException ex)
        {
          // Fall through
        }
      return 0;
    }
docs: Get the number of available bytes in the passed input stream.
  
  @param aIS
  The input stream to use. May be <code>null</code>.
  @return 0 in case of an error or if the parameter was <code>null</code>.