code: public static Reader createReader(InputStream inputStream,String encoding)
      {
          //get encoding
          String updatedEncoding=IOHelper.getEncodingToUse(encoding);
          
          //create reader
          Reader reader=null;
          try
          {
              reader=new InputStreamReader(inputStream,updatedEncoding);
          }
          catch(UnsupportedEncodingException exception)
          {
              throw new FaxException("Unable to create reader, unsupported encoding: "+encoding,exception);
          }
          
          return reader;
      }
docs: This function creates and returns a new reader for the
  provided input stream.
  
  @param   inputStream
  The input stream
  @param   encoding
  The encoding used by the reader (null for default system encoding)
  @return  The reader