public interface StarTableWriter
StarTable in a particular
format.| Modifier and Type | Method and Description |
|---|---|
String |
getFormatName()
Gives the name of the format which is written by this writer.
|
String |
getMimeType()
Returns a string suitable for use as the value of a MIME
Content-Type header.
|
boolean |
looksLikeFile(String location)
Indicates whether the destination is of a familiar form for this
kind of writer.
|
void |
writeStarTable(StarTable startab,
OutputStream out)
Writes a
StarTable object to a given output stream. |
void |
writeStarTable(StarTable startab,
String location,
StarTableOutput sto)
Writes a
StarTable object to a given location. |
void writeStarTable(StarTable startab, OutputStream out) throws TableFormatException, IOException
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.
startab - the table to writeout - the output stream to which startab should be
writtenTableFormatException - if this table cannot be written to a
streamIOException - if there is some I/O errorvoid writeStarTable(StarTable startab, String location, StarTableOutput sto) throws TableFormatException, IOException
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.startab - table to writelocation - destination for startabsto - StarTableOutput which dispatched this requestTableFormatException - if startab cannot be
written to locationIOException - if there is some I/O errorboolean looksLikeFile(String location)
true for values of location which look like
the normal form for their output format, for instance one with
the usual file extension.location - the location name (probably filename)true iff it looks like a file this writer would
normally writeString getFormatName()
String getMimeType()
application/octet-stream"
(for binary formats) or "text/plain" for ASCII ones)
is recommended.Copyright © 2025 Central Laboratory of the Research Councils. All Rights Reserved.