de.esprit.common.io

## Class CountingOutputStream

- java.lang.Object
- - java.io.OutputStream
  - - de.esprit.common.io.CountingOutputStream

- All Implemented Interfaces:
    java.io.Closeable, java.io.Flushable, java.lang.AutoCloseable

      public class CountingOutputStream
      extends java.io.OutputStream

  This stream just counts the bytes that pass through it. Note that this class does intentionally NOT derive from `FilterOutputStream` because the latter one is a significant drawback for performance!
  Author:
    Rainer Buesch

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `CountingOutputStream(java.io.OutputStream out)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `long` | `getByteCount()`
    `long` | `resetByteCount()`
    `void` | `write(byte[] buffer)`
    `void` | `write(byte[] buffer, int offset, int length)`
    `void` | `write(int b)`

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

      `close, flush`

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

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

- - ### Constructor Detail

    - #### CountingOutputStream

          public CountingOutputStream(java.io.OutputStream out)

  - ### Method Detail

    - #### write

          public void write(byte[] buffer)
                     throws java.io.IOException

      Overrides:
        `write` in class `java.io.OutputStream`
      Throws:
        `java.io.IOException`

    - #### write

          public void write(byte[] buffer,
                   int offset,
                   int length)
                     throws java.io.IOException

      Overrides:
        `write` in class `java.io.OutputStream`
      Throws:
        `java.io.IOException`

    - #### write

          public void write(int b)
                     throws java.io.IOException

      Specified by:
        `write` in class `java.io.OutputStream`
      Throws:
        `java.io.IOException`

    - #### getByteCount

          public long getByteCount()

    - #### resetByteCount

          public long resetByteCount()

Copyright © 2014 EsprIT-Systems. All Rights Reserved.