code: public static Attachment fromTextInputStream( InputStream inputStream, MediaType mediaType ) throws IOException {
          return fromText( CharStreams.toString( new InputStreamReader( inputStream, mediaType.getCharset() ) ), mediaType );
      }
docs: Creates a non-binary attachment from the given file.
  @throws IOException if an I/O error occurs
  @throws java.lang.IllegalArgumentException if mediaType is either binary or has no specified charset