### Question:
ZipUtil { public byte[] getEntryBytes(File zipsource, String entry) { if (entry.startsWith("/")) entry = entry.substring(1); InputStream entryStream = null; ByteArrayOutputStream baos = new ByteArrayOutputStream(); try { ZipFile zipFile = new ZipFile(zipsource); setCharset(zipFile); FileHeader header = zipFile.getFileHeader(entry); entryStream = zipFile.getInputStream(header); IOUtils.copy(entryStream, baos); baos.flush(); } catch (Throwable e) { logError(e.getMessage()); } finally { try { baos.close(); entryStream.close(); } catch (Throwable e) { } } return baos.toByteArray(); } ZipUtil();  ZipUtil(String charset); List<ZipEntry> listZipEntries(File zipsource); List<String> listEntries(File zipsource); boolean unzip(String zipsource, String target); byte[] getEntryBytes(File zipsource, String entry); InputStream getEntryStream(File zip, String entry); String getEntryContent(File zip, String entry); static void addEntry(File zip, String entry, InputStream content); void zipFile(File src, File dest); void zipFolder(File inFolder, File outFile); String getFileNameCharset(); void setFileNameCharset(String fileNameCharset);  }### Answer:
@Test public void testGetEntryBytes() throws IOException { File file = new File("target/test.zip"); FileUtil.copyResource("/test.zip", file); ZipUtil zipUtil = new ZipUtil(); zipUtil.setFileNameCharset("UTF-8"); byte[] in = zipUtil.getEntryBytes(file, "index.xml"); Assert.assertEquals(132997526, in.length); }