/** * Copy from reader to writer * * @param input * @param output * @return this request * @throws IOException */ protected HttpRequest copy(final Reader input, final Writer output) throws IOException { return new CloseOperation<HttpRequest>(input, ignoreCloseExceptions) { @Override public HttpRequest run() throws IOException { final char[] buffer = new char[bufferSize]; int read; while ((read = input.read(buffer)) != -1) { output.write(buffer, 0, read); totalWritten += read; progress.onUpload(totalWritten, -1); } return HttpRequest.this; } }.call(); }
/** * Copy from reader to writer * * @param input * @param output * @return this request * @throws IOException */ protected HttpRequest copy(final Reader input, final Writer output) throws IOException { return new CloseOperation<HttpRequest>(input, ignoreCloseExceptions) { @Override public HttpRequest run() throws IOException { final char[] buffer = new char[bufferSize]; int read; while ((read = input.read(buffer)) != -1) { output.write(buffer, 0, read); totalWritten += read; progress.onUpload(totalWritten, -1); } return HttpRequest.this; } }.call(); }
/** * Copy from reader to writer * * @param input * @param output * @return this request * @throws IOException */ protected HttpRequest copy(final Reader input, final Writer output) throws IOException { return new CloseOperation<HttpRequest>(input, ignoreCloseExceptions) { @Override public HttpRequest run() throws IOException { final char[] buffer = new char[bufferSize]; int read; while ((read = input.read(buffer)) != -1) output.write(buffer, 0, read); return HttpRequest.this; } }.call(); }
/** * Copy from reader to writer * * @param input * @param output * @return this request * @throws IOException */ protected HttpRequest copy(final Reader input, final Writer output) throws IOException { return new CloseOperation<HttpRequest>(input, ignoreCloseExceptions) { @Override public HttpRequest run() throws IOException { final char[] buffer = new char[bufferSize]; int read; while ((read = input.read(buffer)) != -1) output.write(buffer, 0, read); return HttpRequest.this; } }.call(); }