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.EmptyByteSourceINSTANCE-
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 CharSourceasCharSource(java.nio.charset.Charset charset)Returns aCharSourceview 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.StringtoString()-
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:ByteSourceReturns aCharSourceview 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 originalByteSourceis returned, rather than round-trip encoding. Subclasses that override this method should behave the same way.- Overrides:
asCharSourcein classByteSource
-
read
public byte[] read()
Description copied from class:ByteSourceReads the full contents of this byte source as a byte array.- Overrides:
readin classByteSource.ByteArrayByteSource
-
toString
public java.lang.String toString()
- Overrides:
toStringin classByteSource.ByteArrayByteSource
-
-