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 using URL.openStream().
  • Field Details

    • url

      private final URL url
  • Constructor Details

    • UrlByteSource

      private UrlByteSource(URL url)
  • Method Details

    • openStream

      public InputStream openStream() throws IOException
      Description copied from class: ByteSource
      Opens a new InputStream 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 class ByteSource
      Throws:
      IOException - if an I/O error occurs while opening the stream
    • toString

      public String toString()
      Overrides:
      toString in class Object