Interface StarTableWriter

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      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.
      boolean looksLikeFile​(java.lang.String location)
      Indicates whether the destination is of a familiar form for this kind of writer.
      void writeStarTable​(StarTable startab, java.io.OutputStream out)
      Writes a StarTable object to a given output stream.
      void writeStarTable​(StarTable startab, java.lang.String location, StarTableOutput sto)
      Writes a StarTable object to a given location.
    • Method Detail

      • writeStarTable

        void writeStarTable​(StarTable startab,
                            java.io.OutputStream out)
                     throws TableFormatException,
                            java.io.IOException
        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:
        startab - 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
      • writeStarTable

        void writeStarTable​(StarTable startab,
                            java.lang.String location,
                            StarTableOutput sto)
                     throws TableFormatException,
                            java.io.IOException
        Writes a StarTable object to a given location. Implementations are free to interpret the location argument in any way appropriate for them. Typically however the location will simply be used to get an output stream (for instance interpreting it as a filename). In this case the sto argument should normally be used to turn location into a stream. StreamStarTableWriter provides a suitable implementation for this case.
        Parameters:
        startab - table to write
        location - destination for startab
        sto - StarTableOutput which dispatched this request
        Throws:
        TableFormatException - if startab cannot be written to location
        java.io.IOException - if there is some I/O error
      • looksLikeFile

        boolean looksLikeFile​(java.lang.String location)
        Indicates whether the destination is of a familiar form for this kind of writer. This may be used to guess what kind of format a table should be written in. Implementations should return true for values of location which look like the normal form for their output format, for instance one with the usual file extension.
        Parameters:
        location - the location name (probably filename)
        Returns:
        true iff it looks like a file this writer would normally write
      • getFormatName

        java.lang.String getFormatName()
        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

        java.lang.String getMimeType()
        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