uk.ac.starlink.feather

## Class FeatherTableWriter

- java.lang.Object
- - uk.ac.starlink.table.formats.DocumentedStreamStarTableWriter
  - - uk.ac.starlink.feather.FeatherTableWriter

- All Implemented Interfaces:
    Documented, DocumentedIOHandler, StarTableWriter

      public class FeatherTableWriter
      extends DocumentedStreamStarTableWriter

  StarTableWriter implementation for writing to Feather format files.
  Since:
    26 Feb 2020

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `FeatherTableWriter()` Default constructor.
    `FeatherTableWriter(boolean isColumnOrder, StoragePolicy storage)` Constructs a writer with custom configuration.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `docIncludesExample()` Indicates whether the serialization of some (short) example table should be added to the user documentation for this handler.
    `java.lang.String` | `getFormatName()` Gives the name of the format which is written by this writer.
    `java.lang.String` | `getMimeType()` Returns a string suitable for use as the value of a MIME Content-Type header.
    `java.lang.String` | `getXmlDescription()` Returns user-directed documentation in XML format.
    `void` | `writeStarTable(StarTable table, java.io.OutputStream out)` Writes a `StarTable` object to a given output stream.

    - ### Methods inherited from class uk.ac.starlink.table.formats.DocumentedStreamStarTableWriter

      `getExtensions, looksLikeFile, writeStarTable`

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

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

    - ### Methods inherited from interface uk.ac.starlink.table.formats.DocumentedIOHandler

      `matchesExtension, readText, toLink`

- - ### Constructor Detail

    - #### FeatherTableWriter

          public FeatherTableWriter()

      Default constructor.

    - #### FeatherTableWriter

          public FeatherTableWriter(boolean isColumnOrder,
                                    StoragePolicy storage)

      Constructs a writer with custom configuration. Output may be written either strictly streamed, by acquiring column information as required, or by scanning all the table rows first and caching bytes in byte stores, then dumping them all to output at the end. Differnt pros and cons; row-oriented is likely to be faster (especially for non-column-oriented input table layout) but requires substantial scratch storage.
      Parameters:
        `isColumnOrder` - true for column-oriented output, false for row-oriented output
        `storage` - storage policy used if required (row-oriented output only)

  - ### Method Detail

    - #### getFormatName

          public java.lang.String getFormatName()

      Description copied from interface: `StarTableWriter`
      Gives the name of the format which is written by this writer. Matching against this string may be used by callers to identify or select this writer from a list.
      Returns:
        a short string identifying the output format of this writer

    - #### getMimeType

          public java.lang.String getMimeType()

      Description copied from interface: `StarTableWriter`
      Returns a string suitable for use as the value of a MIME Content-Type header. If no suitable MIME type is available or known, one of "`application/octet-stream`" (for binary formats) or "`text/plain`" for ASCII ones) is recommended.
      Returns:
        MIME content type

    - #### docIncludesExample

          public boolean docIncludesExample()

      Description copied from interface: `DocumentedIOHandler`
      Indicates whether the serialization of some (short) example table should be added to the user documentation for this handler. Binary formats, or instances for which the `Documented.getXmlDescription()` method already includes some example output, should return false.
      Returns:
        true if the user documentation would benefit from the addition of an example serialization

    - #### getXmlDescription

          public java.lang.String getXmlDescription()

      Description copied from interface: `Documented`
      Returns user-directed documentation in XML format.

      The output should be a sequence of one or more <P> elements, using XHTML-like XML. Since rendering may be done in a number of contexts however, use of the full range of XHTML elements is discouraged. Where possible, the content should stick to simple markup such as the elements P, A, UL, OL, LI, DL, DT, DD EM, STRONG, I, B, CODE, TT, PRE.

      Returns:
        XML description of this object

    - #### writeStarTable

          public void writeStarTable(StarTable table,
                                     java.io.OutputStream out)
                              throws java.io.IOException

      Description copied from interface: `StarTableWriter`
      Writes a `StarTable` object to a given output stream. The implementation can assume that `out` is suitable for direct writing (for instance it should not normally wrap it in a `BufferedOutputStream`), and should not close it at the end of the call.

      Not all table writers are capable of writing to a stream; an implementation may throw a `TableFormatException` to indicate that it cannot do so.

      Parameters:
        `table` - the table to write
        `out` - the output stream to which `startab` should be written
      Throws:
        `TableFormatException` - if this table cannot be written to a stream
        `java.io.IOException` - if there is some I/O error