|
||||||||||
PREV CLASS (src) NEXT CLASS (src) | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
A media converter performs actual conversions of media content. Implementations of this interface can work in one of two ways: Synchronous converters perform conversions completely before returning the input stream on the converted content. Asynchronous converters return a piped input stream immediately after checking the input and spawning a new thread to perform the conversion. The latter has the advantage of being very memory efficient in case the result is consumed immediately, while the first tends to be more robust because it doesn't require the maintenance of additional threads of execution.
The design assumes a converter is instantiated for a specific kind of conversion. Therefore, classes implementing this interface should take a media converter spec as a constructor argument. Said media converter spec should contain the necessary conversion parameters, for example the desired bandwidth for a WAV to MP3 converter.
Method Summary | |
java.io.InputStream |
process(java.io.InputStream inputStream)
Converts the media content offered on the given input stream and returns the converted media content as an input stream. |
void |
process(java.io.InputStream inputStream,
java.io.OutputStream outputStream)
Converts the media content offered on the given input stream and writes the converted media content on the given output stream. |
Method Detail |
public java.io.InputStream process(java.io.InputStream inputStream) throws MediaException (src)
inputStream
- the input stream to process.
java.lang.NullPointerException
- if the value passed is null
.
FormatSyntaxException (src)
- if the content provided with the
input stream does not meet the expected format syntax.
FormatFeatureException (src)
- if the content provided in the
input stream utilizes a format feature not supported by the
receiver.
LinkTranslationException (src)
- if the content provided
contains relative links to child media objects.
ContentAccessException (src)
- if an I/O problem occurs or if
said child links cannot be resolved to child media content.
ConversionException (src)
- if the conversion fails because a
conversion specific problem occurred.
MediaException (src)
public void process(java.io.InputStream inputStream, java.io.OutputStream outputStream) throws MediaException (src)
inputStream
- the stream to process.outputStream
- the processed stream.
java.lang.NullPointerException
- if one the values passed is null
.
FormatSyntaxException (src)
- if the content provided with the
input stream does not meet the expected format syntax.
FormatFeatureException (src)
- if the content provided in the
input stream utilizes a format feature not supported by the
receiver.
LinkTranslationException (src)
- if the content provided
contains relative links to child media objects.
ContentAccessException (src)
- if an I/O problem occurs or if
said child links cannot be resolved to child media content.
ConversionException (src)
- is thrown if the conversion fails
because a conversion specific problem occurred.
MediaException (src)
|
||||||||||
PREV CLASS (src) NEXT CLASS (src) | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |