@Override public void seek(int index) { input.seek(index); }
@Override public void seek(int index) { input.seek(index); }
/** * 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 */ 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); } } }
/** * 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 */ 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); } } }