nl.vpro.api.rs.subtitles.SRTSubtitlesWriter Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of subtitles-domain Show documentation
Show all versions of subtitles-domain Show documentation
Subtitles are related to media, but are implemented completely parallel. Classes to contain, parse, and assemble subtitle objects are here.
The newest version!
package nl.vpro.api.rs.subtitles;
import java.io.IOException;
import java.io.OutputStream;
import jakarta.ws.rs.Produces;
import jakarta.ws.rs.ext.Provider;
import nl.vpro.domain.subtitles.Subtitles;
import nl.vpro.domain.subtitles.SubtitlesFormat;
import nl.vpro.domain.subtitles.SubtitlesUtil;
import static nl.vpro.api.rs.subtitles.Constants.*;
/**
* @author Michiel Meeuwissen
* @since 5.1
*/
@Provider
@Produces(SRT_WITH_CHARSET)
public class SRTSubtitlesWriter extends AbstractSubtitlesWriter {
public SRTSubtitlesWriter() {
super(SubtitlesFormat.SRT);
}
@Override
protected void stream(Subtitles subtitles, OutputStream entityStream) throws IOException {
SubtitlesUtil.toSRT(iterate(subtitles, false), entityStream);
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy