@Override public void consume(OutputStream outputStream) throws IOException { IoUtil.copyResource(classLoader, resourceName, outputStream, false); } },
/** * Reads data from the input stream and writes it to the output stream. Closes none of the two streams. Returns * when no data is {@link InputStream#available() available} on the <var>inputStream</var>. * * @return The number of bytes copied */ public static long copyAvailable(InputStream inputStream, OutputStream outputStream) throws IOException { return IoUtil.copyAvailable(inputStream, outputStream, Long.MAX_VALUE); }
/** * @return All characters that the given {@link Reader} produces */ public static String readAll(Reader reader) throws IOException { return Readers.readAll(reader, false); }
/** * Reads the reader until end-of-input and writes all data to the writer. Closes neither the reader nor the writer. * * @return The number of characters copied */ public static long copy(Reader reader, Writer writer) throws IOException { return IoUtil.copy(reader, false, writer, false); }
/** * Equivalent with {@link #outputFilePrintWriter(File, Charset, ConsumerWhichThrows, boolean) * printToFile(<var>file</var>, <var>charset</var>, <var>printer</var>, false)}. */ public static <EX extends Throwable> void outputFilePrintWriter( File file, Charset charset, ConsumerWhichThrows<? super PrintWriter, ? extends EX> printer ) throws IOException, EX { IoUtil.outputFilePrintWriter(file, charset, printer, false); }
@Override public void write(int b) throws IOException { if (PercentEncoding.isUnreserved(b)) { this.out.write(b); } else { this.writePercentEncoded(b); } }
@Override public void write(char[] cbuf, int off, int len) throws IOException { for (int i = off; i < off + len; i++) this.write(cbuf[i]); }
@Override public void stop() { this.multiplexer.stop(); } }
@Override public int read() throws IOException { byte[] buffer = new byte[1]; return this.read(buffer, 0, 1) == -1 ? -1 : 0xff & buffer[0]; }
/** * @return All characters that the given {@link Reader} produces */ public static String readAll(Reader reader) throws IOException { return IoUtil.readAll(reader, false); }
@Override public void fill(OutputStream os) throws IOException { this.count = IoUtil.writeAndCount(writeContents, os); }
/** * Reads the input stream until end-of-input and writes all data to the output stream. Closes none of the two * streams. * * @return The number of bytes copied */ public static long copy(InputStream inputStream, OutputStream outputStream) throws IOException { return IoUtil.copy(inputStream, outputStream, Long.MAX_VALUE); }
/** * Equivalent with {@link #outputFilePrintWriter(File, Charset, ConsumerWhichThrows, boolean) * printToFile(<var>file</var>, <var>charset</var>, <var>printer</var>, false)}. */ public static <EX extends Throwable> void outputFilePrintWriter( File file, Charset charset, ConsumerWhichThrows<? super PrintWriter, ? extends EX> printer ) throws IOException, EX { IoUtil.outputFilePrintWriter(file, charset, printer, false); }
/** * Reads data from the input stream and writes it to the output stream. Closes none of the two streams. Returns * when no data is {@link InputStream#available() available} on the <var>inputStream</var>. * * @return The number of bytes copied */ public static long copyAvailable(InputStream inputStream, OutputStream outputStream) throws IOException { return IoUtil.copyAvailable(inputStream, outputStream, Long.MAX_VALUE); }
@Override public void consume(OutputStream outputStream) throws IOException { IoUtil.copyResource(classLoader, resourceName, outputStream, false); } },
@Override public void write(char[] cbuf, int off, int len) throws IOException { for (int i = off; i < off + len; i++) this.write(cbuf[i]); }
@Override public void run() throws IOException { IoUtil.copy(in, out); } };
@Override public void consume(OutputStream outputStream) throws IOException { IoUtil.copyResource(clasS, resourceName, outputStream, false); } },
/** * Reads the reader until end-of-input and writes all data to the writer. Closes neither the reader nor the writer. * * @return The number of characters copied */ public static long copy(Reader reader, Writer writer) throws IOException { return IoUtil.copy(reader, false, writer, false); }
@Override public void consume(OutputStream outputStream) throws IOException { IoUtil.copyResource(clasS, resourceName, outputStream, false); } },