Package com.saperion.rmi
Class DirectWriteContentHandler
java.lang.Object
com.saperion.rmi.DirectWriteContentHandler
- All Implemented Interfaces:
SerializableStreamContentHandler,Closeable,AutoCloseable
A
SerializableStreamContentHandler that writes to the archive directly.-
Nested Class Summary
Nested classes/interfaces inherited from interface com.saperion.rmi.SerializableStreamContentHandler
SerializableStreamContentHandler.ContentHandlers -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()booleanlongwrite(SaRMIServerCommand command, int token, String filename, byte[] buffer, boolean isLast, int element, boolean doStreaming) Writes the content.
-
Constructor Details
-
DirectWriteContentHandler
public DirectWriteContentHandler()
-
-
Method Details
-
write
public long write(SaRMIServerCommand command, int token, String filename, byte[] buffer, boolean isLast, int element, boolean doStreaming) throws IOException Description copied from interface:SerializableStreamContentHandlerWrites the content.- Specified by:
writein interfaceSerializableStreamContentHandler- Parameters:
command- server command used for writingtoken- current user tokenfilename- name of the file that is writtenbuffer- data to writeisLast- whether the buffer is the last one to writeelement- content element that is writtendoStreaming- enable or disable streaming to the archive- Returns:
- the number that was assigned to the written element
- Throws:
IOException- IO exception when writing
-
persisted
public boolean persisted()- Specified by:
persistedin interfaceSerializableStreamContentHandler- Returns:
- true if the content written to this content handler was persisted.
-
getInputStream
- Specified by:
getInputStreamin interfaceSerializableStreamContentHandler- Returns:
- Input stream for content that was not yet persisted.
- Throws:
IOException- IO exception when opening stream
-
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable
-