Package com.google.common.io
Class ByteSource.EmptyByteSource
- java.lang.Object
-
- com.google.common.io.ByteSource
-
- com.google.common.io.ByteSource.ByteArrayByteSource
-
- com.google.common.io.ByteSource.EmptyByteSource
-
- Enclosing class:
- ByteSource
private static final class ByteSource.EmptyByteSource extends ByteSource.ByteArrayByteSource
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.google.common.io.ByteSource
ByteSource.AsCharSource
-
-
Field Summary
Fields Modifier and Type Field Description (package private) static ByteSource.EmptyByteSource
INSTANCE
-
Fields inherited from class com.google.common.io.ByteSource.ByteArrayByteSource
bytes, length, offset
-
-
Constructor Summary
Constructors Constructor Description EmptyByteSource()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CharSource
asCharSource(java.nio.charset.Charset charset)
Returns aCharSource
view of this byte source that decodes bytes read from this source as characters using the givenCharset
.byte[]
read()
Reads the full contents of this byte source as a byte array.java.lang.String
toString()
-
Methods inherited from class com.google.common.io.ByteSource.ByteArrayByteSource
copyTo, hash, isEmpty, openBufferedStream, openStream, read, size, sizeIfKnown, slice
-
Methods inherited from class com.google.common.io.ByteSource
concat, concat, concat, contentEquals, copyTo, empty, wrap
-
-
-
-
Field Detail
-
INSTANCE
static final ByteSource.EmptyByteSource INSTANCE
-
-
Method Detail
-
asCharSource
public CharSource asCharSource(java.nio.charset.Charset charset)
Description copied from class:ByteSource
Returns aCharSource
view of this byte source that decodes bytes read from this source as characters using the givenCharset
.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 originalByteSource
is returned, rather than round-trip encoding. Subclasses that override this method should behave the same way.- Overrides:
asCharSource
in classByteSource
-
read
public byte[] read()
Description copied from class:ByteSource
Reads the full contents of this byte source as a byte array.- Overrides:
read
in classByteSource.ByteArrayByteSource
-
toString
public java.lang.String toString()
- Overrides:
toString
in classByteSource.ByteArrayByteSource
-
-