Class 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 Detail

      • url

        private final java.net.URL url
    • Constructor Detail

      • UrlByteSource

        private UrlByteSource​(java.net.URL url)
    • Method Detail

      • openStream

        public java.io.InputStream openStream()
                                       throws java.io.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:
        java.io.IOException - if an I/O error occurs while opening the stream
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object