Package com.google.common.io
Class Resources.UrlByteSource
- java.lang.Object
-
- com.google.common.io.ByteSource
-
- com.google.common.io.Resources.UrlByteSource
-
- Enclosing class:
- Resources
private static final class Resources.UrlByteSource extends ByteSource
A byte source that reads from a URL usingURL.openStream()
.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.google.common.io.ByteSource
ByteSource.AsCharSource
-
-
Field Summary
Fields Modifier and Type Field Description private java.net.URL
url
-
Constructor Summary
Constructors Modifier Constructor Description private
UrlByteSource(java.net.URL url)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.io.InputStream
openStream()
Opens a newInputStream
for reading from this source.java.lang.String
toString()
-
Methods inherited from class com.google.common.io.ByteSource
asCharSource, concat, concat, concat, contentEquals, copyTo, copyTo, empty, hash, isEmpty, openBufferedStream, read, read, size, sizeIfKnown, slice, wrap
-
-
-
-
Method Detail
-
openStream
public java.io.InputStream openStream() throws java.io.IOException
Description copied from class:ByteSource
Opens a newInputStream
for reading from this source. This method returns a new, independent stream each time it is called.The caller is responsible for ensuring that the returned stream is closed.
- Specified by:
openStream
in classByteSource
- Throws:
java.io.IOException
- if an I/O error occurs while opening the stream
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-