public class CloseableDelegateByteSource extends CloseableByteSource
| Constructor and Description |
|---|
CloseableDelegateByteSource(com.google.common.io.ByteSource inner,
long size)
Creates a new byte source.
|
| Modifier and Type | Method and Description |
|---|---|
com.google.common.io.CharSource |
asCharSource(java.nio.charset.Charset charset) |
boolean |
contentEquals(com.google.common.io.ByteSource other) |
long |
copyTo(com.google.common.io.ByteSink sink) |
long |
copyTo(java.io.OutputStream output) |
com.google.common.hash.HashCode |
hash(com.google.common.hash.HashFunction hashFunction) |
protected void |
innerClose()
Mark the byte source as disposed.
|
boolean |
isEmpty() |
java.io.InputStream |
openBufferedStream() |
java.io.InputStream |
openStream() |
byte[] |
read() |
<T> T |
read(com.google.common.io.ByteProcessor<T> processor) |
long |
size() |
long |
sizeNoException()
Obtains the size of this byte source.
|
com.google.common.io.ByteSource |
slice(long offset,
long length) |
closepublic CloseableDelegateByteSource(com.google.common.io.ByteSource inner,
long size)
inner - the inner byte sourcesize - the size of the sourceprotected void innerClose()
throws java.io.IOException
innerClose in class CloseableByteSourcejava.io.IOException - failed to closepublic long sizeNoException()
size() but not throwing IOException.public com.google.common.io.CharSource asCharSource(java.nio.charset.Charset charset)
asCharSource in class com.google.common.io.ByteSourcepublic java.io.InputStream openBufferedStream()
throws java.io.IOException
openBufferedStream in class com.google.common.io.ByteSourcejava.io.IOExceptionpublic com.google.common.io.ByteSource slice(long offset,
long length)
slice in class com.google.common.io.ByteSourcepublic boolean isEmpty()
throws java.io.IOException
isEmpty in class com.google.common.io.ByteSourcejava.io.IOExceptionpublic long size()
throws java.io.IOException
size in class com.google.common.io.ByteSourcejava.io.IOExceptionpublic long copyTo(java.io.OutputStream output)
throws java.io.IOException
copyTo in class com.google.common.io.ByteSourcejava.io.IOExceptionpublic long copyTo(com.google.common.io.ByteSink sink)
throws java.io.IOException
copyTo in class com.google.common.io.ByteSourcejava.io.IOExceptionpublic byte[] read()
throws java.io.IOException
read in class com.google.common.io.ByteSourcejava.io.IOExceptionpublic <T> T read(com.google.common.io.ByteProcessor<T> processor)
throws java.io.IOException
read in class com.google.common.io.ByteSourcejava.io.IOExceptionpublic com.google.common.hash.HashCode hash(com.google.common.hash.HashFunction hashFunction)
throws java.io.IOException
hash in class com.google.common.io.ByteSourcejava.io.IOExceptionpublic boolean contentEquals(com.google.common.io.ByteSource other)
throws java.io.IOException
contentEquals in class com.google.common.io.ByteSourcejava.io.IOExceptionpublic java.io.InputStream openStream()
throws java.io.IOException
openStream in class com.google.common.io.ByteSourcejava.io.IOException