Package opennlp.tools.util
Class ResourceInstaller.BudgetInputStream
java.lang.Object
java.io.InputStream
java.io.FilterInputStream
opennlp.tools.util.ResourceInstaller.BudgetInputStream
- All Implemented Interfaces:
Closeable,AutoCloseable
- Enclosing class:
ResourceInstaller
Charges every byte read or skipped from an expanded stream against a shared budget.
-
Field Summary
FieldsFields inherited from class java.io.FilterInputStream
in -
Constructor Summary
ConstructorsConstructorDescriptionBudgetInputStream(InputStream in, ResourceInstaller.Budget budget) Initializes a budgeted stream. -
Method Summary
Methods inherited from class java.io.FilterInputStream
available, close, mark, markSupported, read, resetMethods inherited from class java.io.InputStream
nullInputStream, readAllBytes, readNBytes, readNBytes, skipNBytes, transferTo
-
Field Details
-
budget
-
-
Constructor Details
-
BudgetInputStream
BudgetInputStream(InputStream in, ResourceInstaller.Budget budget) Initializes a budgeted stream.- Parameters:
in- The expanded stream to read.budget- The budget to charge.
-
-
Method Details
-
read
- Overrides:
readin classFilterInputStream- Throws:
IOException
-
read
- Overrides:
readin classFilterInputStream- Throws:
IOException
-
skip
- Overrides:
skipin classFilterInputStream- Throws:
IOException
-