Class CloseableDelegateByteSource
- java.lang.Object
-
- com.google.common.io.ByteSource
-
- com.android.tools.build.apkzlib.zip.utils.CloseableByteSource
-
- com.android.tools.build.apkzlib.zip.utils.CloseableDelegateByteSource
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable
public class CloseableDelegateByteSource extends CloseableByteSource
Closeable byte source that delegates to another byte source.
-
-
Constructor Summary
Constructors Constructor Description CloseableDelegateByteSource(com.google.common.io.ByteSource inner, long size)Creates a new byte source.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description com.google.common.io.CharSourceasCharSource(java.nio.charset.Charset charset)booleancontentEquals(com.google.common.io.ByteSource other)longcopyTo(com.google.common.io.ByteSink sink)longcopyTo(java.io.OutputStream output)com.google.common.hash.HashCodehash(com.google.common.hash.HashFunction hashFunction)protected voidinnerClose()Mark the byte source as disposed.booleanisEmpty()java.io.InputStreamopenBufferedStream()java.io.InputStreamopenStream()byte[]read()<T> Tread(com.google.common.io.ByteProcessor<T> processor)longsize()longsizeNoException()Obtains the size of this byte source.com.google.common.io.ByteSourceslice(long offset, long length)-
Methods inherited from class com.android.tools.build.apkzlib.zip.utils.CloseableByteSource
close
-
-
-
-
Method Detail
-
innerClose
protected void innerClose() throws java.io.IOExceptionMark the byte source as disposed.- Specified by:
innerClosein classCloseableByteSource- Throws:
java.io.IOException- failed to close
-
sizeNoException
public long sizeNoException()
Obtains the size of this byte source. Equivalent tosize()but not throwingIOException.- Returns:
- the size of the byte source
-
asCharSource
public com.google.common.io.CharSource asCharSource(java.nio.charset.Charset charset)
- Overrides:
asCharSourcein classcom.google.common.io.ByteSource
-
openBufferedStream
public java.io.InputStream openBufferedStream() throws java.io.IOException- Overrides:
openBufferedStreamin classcom.google.common.io.ByteSource- Throws:
java.io.IOException
-
slice
public com.google.common.io.ByteSource slice(long offset, long length)- Overrides:
slicein classcom.google.common.io.ByteSource
-
isEmpty
public boolean isEmpty() throws java.io.IOException- Overrides:
isEmptyin classcom.google.common.io.ByteSource- Throws:
java.io.IOException
-
size
public long size() throws java.io.IOException- Overrides:
sizein classcom.google.common.io.ByteSource- Throws:
java.io.IOException
-
copyTo
public long copyTo(java.io.OutputStream output) throws java.io.IOException- Overrides:
copyToin classcom.google.common.io.ByteSource- Throws:
java.io.IOException
-
copyTo
public long copyTo(com.google.common.io.ByteSink sink) throws java.io.IOException- Overrides:
copyToin classcom.google.common.io.ByteSource- Throws:
java.io.IOException
-
read
public byte[] read() throws java.io.IOException- Overrides:
readin classcom.google.common.io.ByteSource- Throws:
java.io.IOException
-
read
public <T> T read(com.google.common.io.ByteProcessor<T> processor) throws java.io.IOException- Overrides:
readin classcom.google.common.io.ByteSource- Throws:
java.io.IOException
-
hash
public com.google.common.hash.HashCode hash(com.google.common.hash.HashFunction hashFunction) throws java.io.IOException- Overrides:
hashin classcom.google.common.io.ByteSource- Throws:
java.io.IOException
-
contentEquals
public boolean contentEquals(com.google.common.io.ByteSource other) throws java.io.IOException- Overrides:
contentEqualsin classcom.google.common.io.ByteSource- Throws:
java.io.IOException
-
openStream
public java.io.InputStream openStream() throws java.io.IOException- Specified by:
openStreamin classcom.google.common.io.ByteSource- Throws:
java.io.IOException
-
-