org.apache.storm.sql.runtime.serde.csv

## Class CsvSerializer

- java.lang.Object
- - org.apache.storm.sql.runtime.serde.csv.CsvSerializer

- All Implemented Interfaces:
    Serializable, IOutputSerializer

      public class CsvSerializer
      extends Object
      implements IOutputSerializer, Serializable

  CsvSerializer uses the standard RFC4180 CSV Parser One of the difference from Tsv format is that fields with embedded commas will be quoted. eg: a,“b,c”,d is allowed.

  See Also:
    RFC4180, Serialized Form

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `CsvSerializer(List<String> fields)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `ByteBuffer` | `write(List<Object> data, ByteBuffer buffer)` Serialize the data to a ByteBuffer.

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

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

- - ### Constructor Detail

    - #### CsvSerializer

          public CsvSerializer(List<String> fields)

  - ### Method Detail

    - #### write

          public ByteBuffer write(List<Object> data,
                                  ByteBuffer buffer)

      Description copied from interface: `IOutputSerializer`

      Serialize the data to a ByteBuffer. The caller can pass in a ByteBuffer so that the serializer can reuse the memory.

      Specified by:
        `write` in interface `IOutputSerializer`
      Returns:
        A ByteBuffer contains the serialized result.

Copyright © 2021 The Apache Software Foundation. All rights reserved.