@Override public void writeTo(OutputStream os, ProgressMonitor pm) throws IOException { if (onDiskFile == null) { super.writeTo(os, pm); return; } if (pm == null) pm = NullProgressMonitor.INSTANCE; try (FileInputStream in = new FileInputStream(onDiskFile)) { int cnt; final byte[] buf = new byte[Block.SZ]; while ((cnt = in.read(buf)) >= 0) { os.write(buf, 0, cnt); pm.update(cnt / 1024); } } }
new BufferedOutputStream(new FileOutputStream(of)), streamType)) { rawMerged.writeTo(os, null);
monitor.beginTask(monitorTask, (int) (len / 1024)); try (OutputStream os = c.getOutputStream()) { buf.writeTo(os, monitor); } finally { monitor.endTask();
rc = result.getRc(); if (rc == 0) { result.getStdout().writeTo(channel, NullProgressMonitor.INSTANCE);
public void writeTo(OutputStream outstream) throws IOException { // TODO: dont we need a progressmonitor buffer.writeTo(outstream, null); }
/** {@inheritDoc} */ @Override public void writeTo(OutputStream outstream) throws IOException { // TODO: dont we need a progressmonitor buffer.writeTo(outstream, null); }
public void writeTo(OutputStream outstream) throws IOException { // TODO: dont we need a progressmonitor buffer.writeTo(outstream, null); }
NB.encodeInt32(tmp, 4, (int) bb.length()); dos.write(tmp, 0, 8); bb.writeTo(dos, null); } finally { bb.destroy();
buf.writeTo(httpOut, null);
@Override public void writeTo(OutputStream os, ProgressMonitor pm) throws IOException { if (onDiskFile == null) { super.writeTo(os, pm); return; } if (pm == null) pm = NullProgressMonitor.INSTANCE; try (FileInputStream in = new FileInputStream(onDiskFile)) { int cnt; final byte[] buf = new byte[Block.SZ]; while ((cnt = in.read(buf)) >= 0) { os.write(buf, 0, cnt); pm.update(cnt / 1024); } } }
public void writeTo(final OutputStream os, ProgressMonitor pm) throws IOException { if (onDiskFile == null) { super.writeTo(os, pm); return; } if (pm == null) pm = NullProgressMonitor.INSTANCE; final FileInputStream in = new FileInputStream(onDiskFile); try { int cnt; final byte[] buf = new byte[Block.SZ]; while ((cnt = in.read(buf)) >= 0) { os.write(buf, 0, cnt); pm.update(cnt / 1024); } } finally { in.close(); } }
new BufferedOutputStream(new FileOutputStream(of)), streamType)) { rawMerged.writeTo(os, null);
void sendRequest() throws IOException { // Try to compress the content, but only if that is smaller. TemporaryBuffer buf = new TemporaryBuffer.Heap(http.postBuffer); try { GZIPOutputStream gzip = new GZIPOutputStream(buf); out.writeTo(gzip, null); gzip.close(); if (out.length() < buf.length()) buf = out; } catch (IOException err) { // Most likely caused by overflowing the buffer, meaning // its larger if it were compressed. Don't compress. buf = out; } openStream(); if (buf != out) conn.setRequestProperty(HDR_CONTENT_ENCODING, ENCODING_GZIP); conn.setFixedLengthStreamingMode((int) buf.length()); final OutputStream httpOut = conn.getOutputStream(); try { buf.writeTo(httpOut, null); } finally { httpOut.close(); } }
final OutputStream os = c.getOutputStream(); try { buf.writeTo(os, monitor); } finally { monitor.endTask();
monitor.beginTask(monitorTask, (int) (len / 1024)); try (OutputStream os = c.getOutputStream()) { buf.writeTo(os, monitor); } finally { monitor.endTask();
rc = result.getRc(); if (rc == 0) { result.getStdout().writeTo(channel, NullProgressMonitor.INSTANCE);
NB.encodeInt32(tmp, 4, (int) bb.length()); dos.write(tmp, 0, 8); bb.writeTo(dos, null); } finally { bb.destroy();
NB.encodeInt32(tmp, 4, (int) bb.length()); dos.write(tmp, 0, 8); bb.writeTo(dos, null); } finally { bb.destroy();