net.i2p.i2ptunnel.util

## Class ByteLimitOutputStream

- java.lang.Object
- - java.io.OutputStream
  - - java.io.FilterOutputStream
    - - net.i2p.i2ptunnel.util.LimitOutputStream
      - - net.i2p.i2ptunnel.util.ByteLimitOutputStream

- All Implemented Interfaces:
    Closeable, Flushable, AutoCloseable

      public class ByteLimitOutputStream
      extends LimitOutputStream

  An OutputStream that limits how many bytes are written

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from class net.i2p.i2ptunnel.util.LimitOutputStream

      `LimitOutputStream.DoneCallback`

  - ### Field Summary

    - ### Fields inherited from class net.i2p.i2ptunnel.util.LimitOutputStream

      `_callback, _isDone`

    - ### Fields inherited from class java.io.FilterOutputStream

      `out`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ByteLimitOutputStream(OutputStream out, LimitOutputStream.DoneCallback done, long limit)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `write(byte[] src, int off, int len)` Subclasses MUST override the following method such that it calls done() when finished and throws EOFException if called again

    - ### Methods inherited from class net.i2p.i2ptunnel.util.LimitOutputStream

      `isDone, setDone, write`

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

      `close, flush, write`

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

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

- - ### Constructor Detail

    - #### ByteLimitOutputStream

          public ByteLimitOutputStream(OutputStream out,
                                       LimitOutputStream.DoneCallback done,
                                       long limit)

      Parameters:
        `limit` - greater than zero

  - ### Method Detail

    - #### write

          public void write(byte[] src,
                            int off,
                            int len)
                     throws IOException

      Description copied from class: `LimitOutputStream`
      Subclasses MUST override the following method such that it calls done() when finished and throws EOFException if called again
      Overrides:
        `write` in class `LimitOutputStream`
      Throws:
        `IOException`