ch.qos.logback.core.encoder

## Class EncoderBase<E>

- java.lang.Object
- - ch.qos.logback.core.spi.ContextAwareBase
  - - ch.qos.logback.core.encoder.EncoderBase<E>

All Implemented Interfaces:
  Encoder<E>, ContextAware, LifeCycle

Direct Known Subclasses:
  EchoEncoder, LayoutWrappingEncoder, ObjectStreamEncoder

    public abstract class EncoderBase<E>
    extends ContextAwareBase
    implements Encoder<E>

### Field Summary

Fields
`protected java.io.OutputStream` `outputStream`
`protected boolean` `started`

### Fields inherited from class ch.qos.logback.core.spi.ContextAwareBase

`context`

### Constructor Summary

Constructors
Constructor and Description
`EncoderBase()`

### Method Summary

Methods
`void` `init(java.io.OutputStream os)` This method is called when the owning appender starts or whenever output needs to be directed to a new OutputStream, for instance as a result of a rollover.
`boolean` `isStarted()`
`void` `start()`
`void` `stop()`

### Methods inherited from class ch.qos.logback.core.spi.ContextAwareBase

`addError, addError, addInfo, addInfo, addStatus, addWarn, addWarn, getContext, getDeclaredOrigin, getStatusManager, setContext`

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

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

### Methods inherited from interface ch.qos.logback.core.encoder.Encoder

`close, doEncode`

### Methods inherited from interface ch.qos.logback.core.spi.ContextAware

`addError, addError, addInfo, addInfo, addStatus, addWarn, addWarn, getContext, setContext`

### Field Detail

#### started

    protected boolean started

#### outputStream

    protected java.io.OutputStream outputStream

### Constructor Detail

#### EncoderBase

    public EncoderBase()

### Method Detail

#### init

    public void init(java.io.OutputStream os)
              throws java.io.IOException

Description copied from interface: `Encoder`
This method is called when the owning appender starts or whenever output needs to be directed to a new OutputStream, for instance as a result of a rollover. Implementing encoders should at the very least remember the OutputStream passed as argument and use it in future operations.

Specified by:
  `init` in interface `Encoder<E>`
Throws:
  `java.io.IOException`

#### isStarted

    public boolean isStarted()

Specified by:
  `isStarted` in interface `LifeCycle`

#### start

    public void start()

Specified by:
  `start` in interface `LifeCycle`

#### stop

    public void stop()

Specified by:
  `stop` in interface `LifeCycle`