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 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.toString()Methods inherited from class com.google.common.io.ByteSource.ByteArrayByteSource
copyTo, hash, isEmpty, openBufferedStream, openStream, read, size, sizeIfKnown, sliceMethods 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: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
- Overrides:
toStringin classByteSource.ByteArrayByteSource
-