Package com.saperion.rmi
Class DirectWriteContentHandler
- java.lang.Object
-
- com.saperion.rmi.DirectWriteContentHandler
-
- All Implemented Interfaces:
SerializableStreamContentHandler,java.io.Closeable,java.lang.AutoCloseable
public class DirectWriteContentHandler extends java.lang.Object implements SerializableStreamContentHandler
ASerializableStreamContentHandlerthat writes to the archive directly.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.saperion.rmi.SerializableStreamContentHandler
SerializableStreamContentHandler.ContentHandlers
-
-
Constructor Summary
Constructors Constructor Description DirectWriteContentHandler()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()java.io.InputStreamgetInputStream()booleanpersisted()longwrite(SaRMIServerCommand command, int token, java.lang.String filename, byte[] buffer, boolean isLast, int element, boolean doStreaming)Writes the content.
-
-
-
Method Detail
-
write
public long write(SaRMIServerCommand command, int token, java.lang.String filename, byte[] buffer, boolean isLast, int element, boolean doStreaming) throws java.io.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:
java.io.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
public java.io.InputStream getInputStream() throws java.io.IOException- Specified by:
getInputStreamin interfaceSerializableStreamContentHandler- Returns:
- Input stream for content that was not yet persisted.
- Throws:
java.io.IOException- IO exception when opening stream
-
close
public void close()
- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable
-
-