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
-
Nested Class Summary
Nested classes/interfaces inherited from class com.google.common.io.ByteSource
ByteSource.AsCharSource
-
Field Summary
FieldsFields inherited from class com.google.common.io.ByteSource.ByteArrayByteSource
bytes, length, offset
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionasCharSource
(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.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 Details
-
INSTANCE
-
-
Constructor Details
-
EmptyByteSource
EmptyByteSource()
-
-
Method Details
-
asCharSource
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
- Overrides:
toString
in classByteSource.ByteArrayByteSource
-