FTPClient ftpClient;
ZipOutputStream zipOut = null;
zipOut = new ZipOutputStream(ftpClient.storeFileStream("a.zip"));
String str;
byte []conarr=str.getBytes();
zipOut.putNextEntry(new ZipEntry("1.txt"));
zipOut.write(conarr);
zipOut.close();
If str
only has several characters, it's ok,
but if str
is dozens of kB, the zip file has an error.