Interface Contents.Supplier

All Superinterfaces:
AutoCloseable, Supplier<InputStream>
All Known Implementing Classes:
BytesContentSupplier
Enclosing class:
Contents

public static interface Contents.Supplier extends Supplier<InputStream>, AutoCloseable
A supplier that can be called multiple times, each invocation must return a new InputStream ready to read. The number of bytes that can be read from the InputStream must be identical to the number returned by the length method.
  • Method Details

    • length

      long length()
      Returns:
      the number of bytes that can be read from the InputStream returned by calling the get method.
    • close

      void close() throws IOException
      Release the related resources, if any.
      Specified by:
      close in interface AutoCloseable
      Throws:
      IOException - on I/O failure
    • contentAsString

      String contentAsString(Charset charset)
    • reader

      default Reader reader(Charset charset)