/** * Writes bytes to the current tar archive entry. * * This method simply calls write(byte[], int, int). * * @param wBuf The buffer to write to the archive. * @throws IOException on error */ @Override public void write(byte[] wBuf) throws IOException { write(wBuf, 0, wBuf.length); }
/** * Writes a byte to the current tar archive entry. * * This method simply calls read(byte[], int, int). * * @param b The byte written. * @throws IOException on error */ @Override public void write(int b) throws IOException { oneBuf[0] = (byte) b; write(oneBuf, 0, 1); }
pex.setSize(data.length); putNextEntry(pex); write(data); closeEntry();
int count = 0; do { tOut.write(buffer, 0, count); count = in.read(buffer, 0, buffer.length); } while (count != -1);
int read = fis.read(buffer); if (read <= 0) { break; } tos.write(buffer, 0, read);
int read = fis.read(buffer); if (read <= 0) { break; } tos.write(buffer, 0, read);
protected int putFileContent(Launcher launcher, String containerId, String path, String filename, byte[] content, Integer mode) throws IOException, InterruptedException { TarEntry entry = new TarEntry(filename); entry.setUserId(0); entry.setGroupId(0); entry.setSize(content.length); if (mode != null) { entry.setMode(mode); } ByteArrayOutputStream out = new ByteArrayOutputStream(); TarOutputStream tar = new TarOutputStream(out); tar.putNextEntry(entry); tar.write(content); tar.closeEntry(); tar.close(); ArgumentListBuilder args = new ArgumentListBuilder() .add("cp", "-", containerId + ":" + path); return launchDockerCLI(launcher, args) .stdin(new ByteArrayInputStream(out.toByteArray())) .stderr(launcher.getListener().getLogger()).join(); }
te.setSize(data.length); tos.putNextEntry(te); tos.write(data); tos.closeEntry(); tos.flush();
te.setSize(data.length); tos.putNextEntry(te); tos.write(data); tos.closeEntry(); tos.flush();