Class DataBinaryReader

java.lang.Object
cds.savot.binary.DataBinaryReader
All Implemented Interfaces:
SavotDataReader, Closeable, AutoCloseable

public final class DataBinaryReader extends Object implements SavotDataReader

Lets read binary data (that is to say: a votable.resource.table.data.binary node).

A DataBinaryReader must be initialized with a SavotStream object which contains all information to access and read the data, and with a FieldSet which lists all fields (or cells) that are expected in the data. A SavotStream has several attributes that are more or less managed by a DataBinaryReader:

  • href: path to the resource which contains the binary data. This attribute is fully MANAGED !
  • encoding: it specifies how binary data have been encoded. This attribute is MANAGED WITH the value "base64", "gzip" and "dynamic" !
  • expires: data expiration date. After this date, data are supposed to be not valid any more. This attribute is fully MANAGED and can be ignored on demand !
  • rights: it expresses authentication information (i.e. password). This attribute is NOT MANAGED !
  • actuate: it indicates when data have to be fetched (onRequest (by default) or onLoad). This attribute is NOT MANAGED !

HREF attribute

The following protocols are accepted in the "href" attribute: http, https, httpg (not tested at all), ftp and file. If the "href" attribute contains a relative path to a local file, the parent directory must be specified to the reader.

Encoding attribute

The following STREAM encoding are managed: base64, gzip, dynamic. If no encoding is specified, the data will be merely considered as just binary data.

The "dynamic" encoding implies that the data is in a remote resource (specified by the "href" attribute), and the encoding will be delivered with the header of the data. This occurs with the http protocol, where the MIME header (http header field "Content-Encoding") indicates the type of encoding that has been used. In this case only base64 and gzip are accepted.

Expires attribute

If the date given by this attribute has been reached, no data will be read and an IOException will be thrown. However, this attribute can be ignored at the creation of a DataBinaryReader if needed.

Since:
09/2011
Author:
Gregory Mantelet (CDS)