Class ThrottledInputStream.Builder

All Implemented Interfaces:
IOSupplier<ThrottledInputStream>
Enclosing class:
ThrottledInputStream

Builds a new ThrottledInputStream.

Using NIO

ThrottledInputStream in = ThrottledInputStream.builder()
  .setPath(Paths.get("MyFile.xml"))
  .setMaxBytes(100_000, ChronoUnit.SECONDS)
  .get();

Using IO

ThrottledInputStream in = ThrottledInputStream.builder()
  .setFile(new File("MyFile.xml"))
  .setMaxBytes(100_000, ChronoUnit.SECONDS)
  .get();

ThrottledInputStream in = ThrottledInputStream.builder()
  .setInputStream(inputStream)
  .setMaxBytes(100_000, ChronoUnit.SECONDS)
  .get();

Since:
2.16.0
See Also: