org.cloudfoundry.client.lib.io
Class DynamicZipInputStream
java.lang.Object
java.io.InputStream
org.cloudfoundry.client.lib.io.DynamicInputStream
org.cloudfoundry.client.lib.io.DynamicZipInputStream
- All Implemented Interfaces:
- Closeable
public class DynamicZipInputStream
- extends DynamicInputStream
InputStream that dynamically creates ZIP contents as the stream is read without consuming too much memory. Zip
entries
should be provided on construction
.
- Author:
- Phillip Webb
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DynamicZipInputStream
public DynamicZipInputStream(Iterable<DynamicZipInputStream.Entry> entries)
- Create a new
DynamicZipInputStream
instance.
- Parameters:
entries
- the zip entries that should be written to the stream
writeMoreData
protected boolean writeMoreData()
throws IOException
- Description copied from class:
DynamicInputStream
- Called when more data should be written to the
output stream
. This method can be
called many times, implementations should write zero or more bytes to output stream
on
each call. Generally it is recommended that not more that 4096 bytes are written in a single call.
- Specified by:
writeMoreData
in class DynamicInputStream
- Returns:
- false when no more data is available to write.
- Throws:
IOException
close
public void close()
throws IOException
- Specified by:
close
in interface Closeable
- Overrides:
close
in class InputStream
- Throws:
IOException
Copyright © 2013. All rights reserved.