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 TypeMethodDescriptionvoid
close()
boolean
long
write
(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:SerializableStreamContentHandler
Writes the content.- Specified by:
write
in 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:
persisted
in interfaceSerializableStreamContentHandler
- Returns:
- true if the content written to this content handler was persisted.
-
getInputStream
- Specified by:
getInputStream
in interfaceSerializableStreamContentHandler
- Returns:
- Input stream for content that was not yet persisted.
- Throws:
IOException
- IO exception when opening stream
-
close
public void close()- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
-