public InputStream getEntryContent( String path ) throws IOException { ZipEntry entry = getZipFile().getEntry( path ); if ( entry != null ) { return getZipFile().getInputStream( entry ); } else { return null; } }
public InputStream getEntryContent( String path ) throws IOException { ZipEntry entry = getZipFile().getEntry( path ); if ( entry != null ) { return getZipFile().getInputStream( entry ); } else { return null; } }
public InputStream getEntryContent( String path ) throws IOException { ZipEntry entry = getZipFile().getEntry( path ); if ( entry != null ) { return getZipFile().getInputStream( entry ); } else { return null; } }
try (final InputStream in = new BufferedInputStream(zip.getInputStream(entry)); final OutputStream out = new BufferedOutputStream(Files.newOutputStream(expandedFile))) { bytesSoFar = readFile(in, out, observer, bytesSoFar, totalSize);
@Test public final void testGetInputStream() throws IOException { final ZipOutputStream zipOut = newZipOutputStream(new FileOutputStream(file)); try { zipOut.putNextEntry(newEntry("foo")); } finally { zipOut.close(); } final ZipFile zipIn = newZipFile(file); try { zipIn.getInputStream("foo").close(); assertNull(zipIn.getInputStream("bar")); } finally { zipIn.close(); } }
@Test public final void testWriteAndReadSingleBytes() throws IOException { final ZipOutputStream zipOut = newZipOutputStream(new FileOutputStream(file)); zipOut.putNextEntry(newEntry("file")); for (int i = 0; i < data.length; i++) zipOut.write(data[i]); zipOut.close(); final ZipFile zipIn = newZipFile(file); InputStream in = zipIn.getInputStream("file"); for (int i = 0, c; (c = in.read()) != -1; i++) assertEquals(data[i] & 0xFF, c); in.close(); zipIn.close(); }
if (entry != null) { InputStream stream = zipFile.getInputStream(entry); ByteReader reader = null; try {
if (entry != null) { InputStream stream = zipFile.getInputStream(entry); ByteReader reader = null; try {
InputStream in = null; try { in = file.getInputStream(entry); request.open(in); } finally {
InputStream in = null; try { in = file.getInputStream(entry); request.open(in); } finally {
final ZipEntry entry = zipIn.getEntry(name); assertEquals(data1.length, entry.getSize()); final InputStream in = zipIn.getInputStream(name); try { int off = 0;