com.holonplatform.core.streams

## Class LimitedInputStream

- java.lang.Object
- - java.io.InputStream
  - - com.holonplatform.core.streams.LimitedInputStream

- All Implemented Interfaces:
    Closeable, AutoCloseable

      public abstract class LimitedInputStream
      extends InputStream

  Represents a limited `InputStream`, providing the stream length in bytes.
  Since:
    5.1.0

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `LimitedInputStream()`

  - ### Method Summary

    All Methods Static Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static LimitedInputStream` | `create(InputStream stream, long length)` Create a new `LimitedInputStream`.
    `abstract InputStream` | `getActualStream()` Get the actual `InputStream` if acts as a wrapper.
    `abstract long` | `getLength()` Get the stream length.

    - ### Methods inherited from class java.io.InputStream

      `available, close, mark, markSupported, read, read, read, reset, skip`

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### LimitedInputStream

          public LimitedInputStream()

  - ### Method Detail

    - #### getLength

          public abstract long getLength()

      Get the stream length.
      Returns:
        the stream length in bytes

    - #### getActualStream

          public abstract InputStream getActualStream()

      Get the actual `InputStream` if acts as a wrapper.
      Returns:
        the actual `InputStream`, maybe the instance itself

    - #### create

          public static LimitedInputStream create(InputStream stream,
                                                  long length)

      Create a new `LimitedInputStream`.
      Parameters:
        `stream` - The input stream (not null)
        `length` - The stream length in bytes
      Returns:
        A new `LimitedInputStream` instance

Copyright © 2019 The Holon Platform. All rights reserved.