edu.northwestern.at.morphadorner.corpuslinguistics.outputter

## Class ByteStreamAdornedWordOutputter

- java.lang.Object
- - edu.northwestern.at.morphadorner.corpuslinguistics.outputter.PrintStreamAdornedWordOutputter
  - - edu.northwestern.at.morphadorner.corpuslinguistics.outputter.ByteStreamAdornedWordOutputter

- All Implemented Interfaces:
    AdornedWordOutputter

      public class ByteStreamAdornedWordOutputter
      extends PrintStreamAdornedWordOutputter
      implements AdornedWordOutputter

  Tagged word outputter which writes to a ByteStream.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected java.io.ByteArrayOutputStream` | `byteArrayOutputStream` Byte array output stream.

    - ### Fields inherited from class edu.northwestern.at.morphadorner.corpuslinguistics.outputter.PrintStreamAdornedWordOutputter

      `fileEncoding, fileName, printStream, separatorCharacter, wordAttributeNames`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ByteStreamAdornedWordOutputter()` Create byte stream outputter.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `close()` Close outputter.
    `void` | `createOutputFile(java.lang.String fileName, java.lang.String encoding, char separatorCharacter)` Create output file.
    `byte[]` | `getBytes()` Get byte array from output stream.

    - ### Methods inherited from class edu.northwestern.at.morphadorner.corpuslinguistics.outputter.PrintStreamAdornedWordOutputter

      `getOutputFileEncoding, getOutputFileName, outputWordAndAdornments, outputWordAndAdornments, setWordAttributeNames`

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

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

    - ### Methods inherited from interface edu.northwestern.at.morphadorner.corpuslinguistics.outputter.AdornedWordOutputter

      `getOutputFileEncoding, getOutputFileName, outputWordAndAdornments, outputWordAndAdornments, setWordAttributeNames`

- - ### Field Detail

    - #### byteArrayOutputStream

          protected java.io.ByteArrayOutputStream byteArrayOutputStream

      Byte array output stream.

  - ### Constructor Detail

    - #### ByteStreamAdornedWordOutputter

          public ByteStreamAdornedWordOutputter()

      Create byte stream outputter.

  - ### Method Detail

    - #### createOutputFile

          public void createOutputFile(java.lang.String fileName,
                              java.lang.String encoding,
                              char separatorCharacter)
                                throws java.io.IOException

      Create output file.
      Specified by:
        `createOutputFile` in interface `AdornedWordOutputter`
      Overrides:
        `createOutputFile` in class `PrintStreamAdornedWordOutputter`
      Parameters:
        `fileName` - Output file name (stored, not used).
        `encoding` - Encoding for the output file.
        `separatorCharacter` - Separator character for output.
      Throws:
        `java.io.IOException`

    - #### getBytes

          public byte[] getBytes()

      Get byte array from output stream.

    - #### close

          public void close()

      Close outputter.
      Specified by:
        `close` in interface `AdornedWordOutputter`
      Overrides:
        `close` in class `PrintStreamAdornedWordOutputter`