# Class CounterOutputStream

java.lang.Object
java.io.OutputStream
org.apache.jmeter.protocol.smtp.sampler.tools.CounterOutputStream

All Implemented Interfaces:
  `Closeable, Flushable, AutoCloseable`

public class CounterOutputStream extends OutputStream
Utility-class to calculate message size.

## Constructor Summary

Constructors
Constructor
Description
`CounterOutputStream()`

## Method Summary

Modifier and Type
Method
Description
`void`
`close()`
`void`
`flush()`
`int`
`getCount()`
Returns message size
`void`
`write(byte[] b, int off, int len)`
`void`
`write(int b)`

### Methods inherited from class OutputStream

`nullOutputStream, write`

### Methods inherited from class Object

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

## Constructor Details

### CounterOutputStream

public CounterOutputStream()

## Method Details

### close

public void close()

Specified by:
  `close` in interface `AutoCloseable`
Specified by:
  `close` in interface `Closeable`
Overrides:
  `close` in class `OutputStream`

### flush

public void flush()

Specified by:
  `flush` in interface `Flushable`
Overrides:
  `flush` in class `OutputStream`

### write

public void write(byte[] b, int off, int len)

Overrides:
  `write` in class `OutputStream`

### write

public void write(int b)

Specified by:
  `write` in class `OutputStream`

### getCount

public int getCount()
Returns message size

Returns:
  Message size