Package com.saperion.common.io
Class ReadOnceTempFileByteBuffer
java.lang.Object
com.saperion.common.io.TempFileByteBuffer
com.saperion.common.io.ReadOnceTempFileByteBuffer
- All Implemented Interfaces:
Closeable,AutoCloseable
This sub-class of
TempFileByteBuffer is only capable to return one InputStream. When this call is
invoked the responsibility to delete a possible temporary file is given to the input stream which in turn will
delete said file when closed.- Author:
- jschwarz
-
Field Summary
Fields inherited from class com.saperion.common.io.TempFileByteBuffer
MINIMUM_BUFFER_SIZE -
Constructor Summary
ConstructorsConstructorDescriptionReadOnceTempFileByteBuffer(int inMemoryBytes) ReadOnceTempFileByteBuffer(int inMemoryBytes, File tempFileDirectory) -
Method Summary
Methods inherited from class com.saperion.common.io.TempFileByteBuffer
append, append, append, getDirectory, getMaxInMemoryBytes, getSize, inMemory
-
Constructor Details
-
ReadOnceTempFileByteBuffer
public ReadOnceTempFileByteBuffer(int inMemoryBytes) - Parameters:
inMemoryBytes- number of bytes to keep in memory before using a temp file
-
ReadOnceTempFileByteBuffer
- Parameters:
inMemoryBytes- number of bytes to keep in memory before using a temp filetempFileDirectory- directory to store temporary files in
-
-
Method Details
-
getInputStream
- Overrides:
getInputStreamin classTempFileByteBuffer- Returns:
- an input stream to read the bytes stored in this buffer
- Throws:
IOException- IO exception when opering the stream
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classTempFileByteBuffer- Throws:
IOException
-