All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.gc.iotools.fmt.decoders.TSDDecoder Maven / Gradle / Ivy

The newest version!
package com.gc.iotools.fmt.decoders;

import java.io.BufferedInputStream;
import java.io.IOException;
import java.io.InputStream;

import com.gc.iotools.fmt.base.Decoder;
import com.gc.iotools.fmt.base.FormatEnum;

/**
 * Decoder for TSD (TimeStampedData) documents.
 * 
 * @author Giacomo Boccardo ([email protected])
 *
 * @see Decoder
 */
public class TSDDecoder implements Decoder {

	@Override
	public InputStream decode(final InputStream tsdIS) throws IOException {
		TimeStampedDataParser tsdParser;
		try {
			tsdParser = new TimeStampedDataParser(tsdIS);
		} catch (final IOException e) {
			throw new IOException("Error parsing TSD content", e);
		}

		return new BufferedInputStream(tsdParser.getContentAsIS());
	}


	@Override
	public FormatEnum getFormat() {
		return FormatEnum.TSD;
	}

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy