try {
reader = new InputStreamReader(in, charset);
writer = new OutputStreamWriter(out, charset);
CurrentResourceContext crc = (CurrentResourceContext) CurrentResourceContext.getInstance(FacesContext.getCurrentInstance());
// add comment to the packed resource before writing the file into stream
writer.write(String.format("/* resource: %s */\n", ResourceKey.create(crc.getResource())));
writer.flush();
StreamUtils.copy(in, out);
writer.write("\n\n");