public class DataSourceStreamingDataHandler extends AbstractStreamingDataHandler
| Constructor and Description |
|---|
DataSourceStreamingDataHandler(DataSource aDataSource) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
InputStream |
readOnce()
Works like
DataHandler.getInputStream() except that this method can be invoked
only once. |
getHrefCid, setHrefCidgetAllCommands, getBean, getCommand, getContent, getContentType, getDataSource, getInputStream, getName, getOutputStream, getPreferredCommands, getTransferData, getTransferDataFlavors, isDataFlavorSupported, setCommandMap, setDataContentHandlerFactory, writeTopublic DataSourceStreamingDataHandler(@Nonnull DataSource aDataSource)
public InputStream readOnce() throws IOException
AbstractStreamingDataHandlerDataHandler.getInputStream() except that this method can be invoked
only once.DataHandler.getInputStream() invocation nor AbstractStreamingDataHandler.readOnce() invocation on
this object (which would result in IOException.)DataHandler is backed by a streaming BLOB (such as an
attachment in a web service read from the network), this allows the callee
to avoid unnecessary buffering.DataHandler.getInputStream() multiple times and
then call AbstractStreamingDataHandler.readOnce() afterward. Streams created such a way can be
read in any order - there's no requirement that streams created earlier
must be read first.readOnce in class AbstractStreamingDataHandlernull. Represents the content of this BLOB.
The returned stream is generally not buffered, so for better
performance read in a big batch or wrap this into
BufferedInputStream.IOException - if any i/o errorpublic void close()
throws IOException
IOExceptionCopyright © 2014–2019 Philip Helger. All rights reserved.