byte[] name = entry.getName().getBytes();
byte[] name; try { name = entry.getName().getBytes("UTF-8"); } catch (UnsupportedEncodingException uee) { throw new AssertionError(uee); }
  public void finish() throws IOException  {		if (entries == null)			return;		if (curEntry != null)			closeEntry();		int numEntries = 0;		int sizeEntries = 0;		Enumeration e = entries.elements();    while (e.hasMoreElements())      {			ZipEntry entry = (ZipEntry) e.nextElement();			int method = entry.getMethod();			writeLeInt(CENSIG);	writeLeShort(method == STORED		     ? ZIP_STORED_VERSION : ZIP_DEFLATED_VERSION);	writeLeShort(method == STORED		     ? ZIP_STORED_VERSION : ZIP_DEFLATED_VERSION);			writeLeShort(entry.flags);			writeLeShort(method);			writeLeInt(entry.getDOSTime());	writeLeInt((int)entry.getCrc());	writeLeInt((int)entry.getCompressedSize());	writeLeInt((int)entry.getSize());			byte[] name = entry.getName().getBytes();			if (name.length > 0xffff)				throw new ZipException("Name too long.");			byte[] extra = entry.getExtra();			if (extra == null)				extra = new byte[0];			String strComment = entry.getComment();	byte[] comment = strComment != null	  ? strComment.getBytes() : new byte[0];			if (comment.length > 0xffff)				throw new ZipException("Comment too long.");			writeLeShort(name.length);			writeLeShort(extra.length);			writeLeShort(comment.length);			writeLeShort(0); /* disk number */			writeLeShort(0); /* internal file attr */			writeLeInt(0); /* external file attr */			writeLeInt(entry.offset);			out.write(name);			out.write(extra);			out.write(comment);			numEntries++;			sizeEntries += CENHDR + name.length + extra.length + comment.length;		}		writeLeInt(ENDSIG);		writeLeShort(0); /* disk number */		writeLeShort(0); /* disk with start of central dir */		writeLeShort(numEntries);		writeLeShort(numEntries);		writeLeInt(sizeEntries);		writeLeInt(offset);		writeLeShort(zipComment.length);		out.write(zipComment);		out.flush();		entries = null;	}