Package com.saperion.rmi
Class TempBufferContentHandler
java.lang.Object
com.saperion.rmi.TempBufferContentHandler
- All Implemented Interfaces:
- SerializableStreamContentHandler,- Closeable,- AutoCloseable
A 
SerializableStreamContentHandler that writes to a temporary buffer.- 
Nested Class SummaryNested classes/interfaces inherited from interface com.saperion.rmi.SerializableStreamContentHandlerSerializableStreamContentHandler.ContentHandlers
- 
Constructor SummaryConstructorsConstructorDescriptionDefault constructor that reads the following settings from saperion.properties.
- 
Method SummaryModifier and TypeMethodDescriptionvoidclose()booleanlongwrite(SaRMIServerCommand command, int token, String filename, byte[] buffer, boolean isLast, int element, boolean doStreaming) Writes the content.
- 
Constructor Details- 
TempBufferContentHandlerpublic TempBufferContentHandler()Default constructor that reads the following settings from saperion.properties.- operations.binary.tempdir = the directory to store the temporary files
- operations.binary.inmemorybytes = number of bytes to keep in memory
 
 
- 
- 
Method Details- 
writepublic 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 interface- SerializableStreamContentHandler
- Parameters:
- command- server command used for writing
- token- current user token
- filename- name of the file that is written
- buffer- data to write
- isLast- whether the buffer is the last one to write
- element- content element that is written
- doStreaming- enable or disable streaming to the archive
- Returns:
- the number that was assigned to the written element
- Throws:
- IOException- IO exception when writing
 
- 
persistedpublic boolean persisted()- Specified by:
- persistedin interface- SerializableStreamContentHandler
- Returns:
- true if the content written to this content handler was persisted.
 
- 
getInputStream- Specified by:
- getInputStreamin interface- SerializableStreamContentHandler
- Returns:
- Input stream for content that was not yet persisted.
- Throws:
- IOException- IO exception when opening stream
 
- 
close- Specified by:
- closein interface- AutoCloseable
- Specified by:
- closein interface- Closeable
- Throws:
- IOException
 
 
-