private static final class ByteSource.EmptyByteSource extends ByteSource.ByteArrayByteSource
ByteSource.AsCharSource| Modifier and Type | Field and Description |
|---|---|
(package private) static ByteSource.EmptyByteSource |
INSTANCE |
bytes, length, offset| Constructor and Description |
|---|
EmptyByteSource() |
| Modifier and Type | Method and Description |
|---|---|
CharSource |
asCharSource(java.nio.charset.Charset charset)
Returns a
CharSource view of this byte source that decodes bytes read from this source
as characters using the given Charset. |
byte[] |
read()
Reads the full contents of this byte source as a byte array.
|
java.lang.String |
toString() |
copyTo, hash, isEmpty, openBufferedStream, openStream, read, size, sizeIfKnown, sliceconcat, concat, concat, contentEquals, copyTo, empty, wrapstatic final ByteSource.EmptyByteSource INSTANCE
public CharSource asCharSource(java.nio.charset.Charset charset)
ByteSourceCharSource view of this byte source that decodes bytes read from this source
as characters using the given Charset.
If CharSource.asByteSource(java.nio.charset.Charset) is called on the returned source with the same charset,
the default implementation of this method will ensure that the original ByteSource is
returned, rather than round-trip encoding. Subclasses that override this method should behave
the same way.
asCharSource in class ByteSourcepublic byte[] read()
ByteSourceread in class ByteSource.ByteArrayByteSourcepublic java.lang.String toString()
toString in class ByteSource.ByteArrayByteSource