Writes an binary file entry to the ZIP output stream.
@param path Content path
@param is Input stream with binary data
@throws IOException I/O exception
552041
private void writeBinaryFile(String path, InputStream is) throws IOException {
    zip.putNextEntry(new ZipEntry(path));
    try {
      IOUtils.copy(is, zip);
    }
    finally {
      zip.closeEntry();
    }
  }
677883
public void write(InputStream is, long length, boolean escape, boolean noBackslashEscapes)
      throws IOException {
    byte[] array = new byte[4096];
    int len;
    while (length > 0 && (len = is.read(array, 0, Math.min(4096, (int) length))) > 0) {
      if (escape) {
        writeBytesEscaped(array, len, noBackslashEscapes);
      } else {
        write(array, 0, len);
      }
      length -= len;
    }
  }
653001
public void inputStreamToFile(InputStream is, String filename) throws IOException {
        FileOutputStream fos = new FileOutputStream(filename);
        inputStreamToOutputStream(is, fos);
        fos.close();
    }
1094534
public static void writeTo(String path) throws IOException, NoSuchMethodException, IllegalAccessException,
            InvocationTargetException {
        MsUtils.writeTo(xssfWorkbook, path);
    }
1238489
public static void write(Path self, String text, String charset) throws IOException {
        Writer writer = null;
        try {
            writer = new OutputStreamWriter(Files.newOutputStream(self, CREATE, APPEND), Charset.forName(charset));
            writer.write(text);
            writer.flush();

            Writer temp = writer;
            writer = null;
            temp.close();
        } finally {
            closeWithWarning(writer);
        }
    }
400440
public static void write(InputStream in, Path path) {
        write(in, path, StandardCopyOption.REPLACE_EXISTING);
    }
222089
public void toFile(Path path, OpenOption... options) throws IOException {
        Files.write(path, pBytes, options);

    }
20404
public Boolean writeThyFiles(String path) throws IOException
	{
		File modelThyFile = new File(path + modelThyName);
		FileUtils.writeStringToFile(modelThyFile, modelThy.getContent());

		File posThyFile = new File(path + posThyName);
		FileUtils.writeStringToFile(posThyFile, posThy);

		return true;
	}
576725
@Override
    protected void zipFile(InputStream is, ZipOutputStream zOut, String vPath,
            long lastModified, File fromArchive, int mode) throws IOException {
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        IoUtil.copy(is, baos, buf);
        struct.data = baos.toByteArray();
        struct.name = vPath;
        struct.time = lastModified;
        if (proc.process(struct) != JarProcessor.Result.DISCARD) {
            if (mode == 0)
                mode = ZipFileSet.DEFAULT_FILE_MODE;
            if (!filesOnly) {
                addParentDirs(struct.name, zOut);
            }
            super.zipFile(new ByteArrayInputStream(struct.data),
                    zOut, struct.name, struct.time, fromArchive, mode);
        }
    }
960134
@Override
    public void writeByteStream(InputStream is)
        throws IOException
    {
        while (true) {
            int len = SIZE - _offset - 3;

            if (len < 16) {
                flushBuffer();
                len = SIZE - _offset - 3;
            }

            len = is.read(_buffer, _offset + 3, len);

            if (len <= 0) {
                _buffer[_offset++] = BC_BINARY_DIRECT;
                return;
            }

            _buffer[_offset + 0] = (byte) BC_BINARY_CHUNK;
            _buffer[_offset + 1] = (byte) (len >> 8);
            _buffer[_offset + 2] = (byte) (len);

            _offset += len + 3;
        }
    }
1142764
public static void writeStringToFile(String path, String toWrite, Configuration hadoopConfig) throws IOException {
        FileSystem fileSystem = FileSystem.get(hadoopConfig);
        try (BufferedOutputStream bos = new BufferedOutputStream(fileSystem.create(new Path(path)))) {
            bos.write(toWrite.getBytes("UTF-8"));
        }
    }
470029
public static void setBytes(Path self, byte[] bytes) throws IOException {
        IOGroovyMethods.setBytes(Files.newOutputStream(self), bytes);
    }
424037
def write(self, path, data, offset=0, timeout=0):
        

        # fixme: check of path type delayed to str2bytez
        if not isinstance(data, (bytes, bytearray, )):
            raise TypeError("'data' argument must be binary")

        ret, rdata = self.sendmess(MSG_WRITE, str2bytez(path) + data,
                                   size=len(data), offset=offset,
                                   timeout=timeout)
        assert not rdata, (ret, rdata)
        if ret < 0:
            raise OwnetError(-ret, self.errmess[-ret], path)
1292432
public void addFile(String path, InputStream inputStream) throws IOException {
    addFile(path, inputStream, null);
  }
860384
public static void saveTo(String path, InputStream in) throws IOException {
        if (in == null)
            throw new IllegalArgumentException("input stream cannot be null");
        if (path == null)
            throw new IllegalArgumentException("path cannot be null");

        try (OutputStream out = new BufferedOutputStream(
                                        Files.newOutputStream(
                                                Paths.get(path), 
                                                StandardOpenOption.CREATE, 
                                                StandardOpenOption.APPEND))) {
            byte[] bytes = new byte[1024];
            for (int x = in.read(bytes); x != -1; x = in.read(bytes))
                out.write(bytes, 0, x);
        }
    }
968382
public static void extract(InputStream is, File outputFolder) throws IOException {
        ZipInputStream zis = new ZipInputStream(is);
        ZipEntry entry;
        byte[] buffer = new byte[1024];

        while ((entry = zis.getNextEntry()) != null) {
            File outputFile = new File(outputFolder.getCanonicalPath() + File.separatorChar + entry.getName());
            File outputParent = new File(outputFile.getParent());
            outputParent.mkdirs();

            if (entry.isDirectory()) {
                if (!outputFile.exists()) {
                    outputFile.mkdir();
                }
            } else {
                try (FileOutputStream fos = new FileOutputStream(outputFile)) {
                    int len;
                    while ((len = zis.read(buffer)) > 0) {
                        fos.write(buffer, 0, len);
                    }
                }
            }
        }
    }
713562
def save(path)
      update
      Zip::OutputStream.open(path) do |out|
        zip.each do |entry|
          next unless entry.file?
          out.put_next_entry(entry.name)

          if @replace[entry.name]
            out.write(@replace[entry.name])
          else
            out.write(zip.read(entry.name))
          end
        end
      end
      zip.close
    end