public static interface FileBasedSink.WritableByteChannelFactory
extends java.io.Serializable
WritableByteChannel
used by FileBasedSink
and related classes to allow decorating, or otherwise transforming, the raw data that
would normally be written directly to the WritableByteChannel
passed into
create(WritableByteChannel)
.
Subclasses should override Object.toString()
with something meaningful, as it is used when
building DisplayData
.
Modifier and Type | Method and Description |
---|---|
java.nio.channels.WritableByteChannel |
create(java.nio.channels.WritableByteChannel channel) |
java.lang.String |
getFilenameSuffix() |
java.lang.String |
getMimeType()
Returns the MIME type that should be used for the files that will hold the output data.
|
java.nio.channels.WritableByteChannel create(java.nio.channels.WritableByteChannel channel) throws java.io.IOException
channel
- the WritableByteChannel
to wrapWritableByteChannel
to be used during outputjava.io.IOException
@Nullable java.lang.String getMimeType()
null
if this WritableByteChannelFactory
does not meaningfully change
the MIME type (e.g., for FileBasedSink.CompressionType.UNCOMPRESSED
).MimeTypes
,
http://www.iana.org/assignments/media-types/media-types.xhtml@Nullable java.lang.String getFilenameSuffix()
FileBasedSink.CompressionType.GZIP