code: public void setEncoding(String enc) throws IOException {
          if (source != null) //applicapble to URL streams only
          {
              String current = encoding;
              if (current == null)
                  current = Charset.defaultCharset().name();
              if (!current.equalsIgnoreCase(enc)) {
                  int oldindex = input.index();
                  source.close();
                  encoding = enc;
                  CSSInputStream newstream = urlStream(url, network, encoding);
                  input = newstream.input;
                  input.seek(oldindex);
              }
          }
      }
docs: Sets a new encoding for the input stream. <b>Warning:</b> this resets the stream
  i.e. a new connection is opened and all the data is read again.
  
  @param enc The new encoding name.
  @throws IOException