Package com.saperion.rmi
Class TempBufferContentHandler
- java.lang.Object
-
- com.saperion.rmi.TempBufferContentHandler
-
- All Implemented Interfaces:
SerializableStreamContentHandler
,java.io.Closeable
,java.lang.AutoCloseable
public class TempBufferContentHandler extends java.lang.Object implements SerializableStreamContentHandler
ASerializableStreamContentHandler
that writes to a temporary buffer.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.saperion.rmi.SerializableStreamContentHandler
SerializableStreamContentHandler.ContentHandlers
-
-
Constructor Summary
Constructors Constructor Description TempBufferContentHandler()
Default constructor that reads the following settings from saperion.properties.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
java.io.InputStream
getInputStream()
boolean
persisted()
long
write(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: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:
java.io.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
public java.io.InputStream getInputStream() throws java.io.IOException
- Specified by:
getInputStream
in interfaceSerializableStreamContentHandler
- Returns:
- Input stream for content that was not yet persisted.
- Throws:
java.io.IOException
- IO exception when opening stream
-
close
public void close() throws java.io.IOException
- Specified by:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfacejava.io.Closeable
- Throws:
java.io.IOException
-
-