Package org.apache.felix.framework.util
Class WeakZipFileFactory.WeakZipFile.WeakZipInputStream
- java.lang.Object
-
- java.io.InputStream
-
- org.apache.felix.framework.util.WeakZipFileFactory.WeakZipFile.WeakZipInputStream
-
- All Implemented Interfaces:
java.io.Closeable
,java.lang.AutoCloseable
- Enclosing class:
- WeakZipFileFactory.WeakZipFile
class WeakZipFileFactory.WeakZipFile.WeakZipInputStream extends java.io.InputStream
This is an InputStream wrapper that will properly reopen the underlying zip file if it is weakly closed and create the underlying input stream.
-
-
Field Summary
Fields Modifier and Type Field Description private int
m_currentPos
private java.lang.String
m_entryName
private java.io.InputStream
m_is
private java.util.zip.ZipFile
m_zipFileSnapshot
-
Constructor Summary
Constructors Constructor Description WeakZipInputStream(java.lang.String entryName, java.io.InputStream is)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
available()
void
close()
private void
ensureInputStreamIsValid()
This internal method ensures that the zip file is open and that the underlying input stream is valid.void
mark(int i)
boolean
markSupported()
int
read()
int
read(byte[] bytes)
int
read(byte[] bytes, int i, int i1)
void
reset()
long
skip(long l)
-
-
-
Method Detail
-
ensureInputStreamIsValid
private void ensureInputStreamIsValid() throws java.io.IOException
This internal method ensures that the zip file is open and that the underlying input stream is valid. Upon successful completion, the underlying input stream will be valid and the local mutex will be held.- Throws:
java.io.IOException
- if the was an error handling the input stream.
-
available
public int available() throws java.io.IOException
- Overrides:
available
in classjava.io.InputStream
- Throws:
java.io.IOException
-
close
public void close() throws java.io.IOException
- Specified by:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfacejava.io.Closeable
- Overrides:
close
in classjava.io.InputStream
- Throws:
java.io.IOException
-
mark
public void mark(int i)
- Overrides:
mark
in classjava.io.InputStream
-
markSupported
public boolean markSupported()
- Overrides:
markSupported
in classjava.io.InputStream
-
read
public int read() throws java.io.IOException
- Specified by:
read
in classjava.io.InputStream
- Throws:
java.io.IOException
-
read
public int read(byte[] bytes) throws java.io.IOException
- Overrides:
read
in classjava.io.InputStream
- Throws:
java.io.IOException
-
read
public int read(byte[] bytes, int i, int i1) throws java.io.IOException
- Overrides:
read
in classjava.io.InputStream
- Throws:
java.io.IOException
-
reset
public void reset() throws java.io.IOException
- Overrides:
reset
in classjava.io.InputStream
- Throws:
java.io.IOException
-
skip
public long skip(long l) throws java.io.IOException
- Overrides:
skip
in classjava.io.InputStream
- Throws:
java.io.IOException
-
-