Code example for FileInputStream

Methods: close, read

0
	 
	public void addChar(File chrf) throws IOException {
		 
		File tchrf = new File(ptdir, "/temp/assets/mob/char.png");
		tchrf.delete();
		InputStream is = new FileInputStream(chrf);
		byte[] bytes = new byte[(int) chrf.length()];
		is.read(bytes);
		is.close();
 
		OutputStream os = new FileOutputStream(tchrf);
		os.write(bytes);
		os.close();
 
	} 
	 
	public void addTexture(File text) throws IOException {
		File out = new File(ptdir, "/Textures/" + text.getName());
		File temp = new File(ptdir, "/temp");
		ZipUtils.copyFolder(out, temp);