Class CloseableByteSource
- java.lang.Object
-
- com.google.common.io.ByteSource
-
- com.android.tools.build.apkzlib.zip.utils.CloseableByteSource
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable
- Direct Known Subclasses:
CloseableDelegateByteSource,InflaterByteSource,LazyDelegateByteSource
public abstract class CloseableByteSource extends com.google.common.io.ByteSource implements java.io.CloseableByte source that can be closed. Closing a byte source allows releasing any resources associated with it. This should not be confused with closing streams. For example,ByteTrackerusesCloseableByteSourcesto know when the data associated with the byte source can be released.
-
-
Constructor Summary
Constructors Constructor Description CloseableByteSource()Creates a new byte source.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidclose()protected abstract voidinnerClose()Closes the by source.
-
-
-
Method Detail
-
close
public final void close() throws java.io.IOException- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable- Throws:
java.io.IOException
-
innerClose
protected abstract void innerClose() throws java.io.IOExceptionCloses the by source. This method is only invoked once, even ifclose()is called multiple times.- Throws:
java.io.IOException- failed to close
-
-