Package com.saperion.common.io
Class TempFileByteBufferOutputStream
java.lang.Object
java.io.OutputStream
com.saperion.common.io.TempFileByteBufferOutputStream
- All Implemented Interfaces:
Closeable
,Flushable
,AutoCloseable
An
OutputStream
that stores it's data in a TempFileByteBuffer
.-
Constructor Summary
ConstructorsConstructorDescriptionTempFileByteBufferOutputStream
(int inMemoryBytes) TempFileByteBufferOutputStream
(int inMemoryBytes, File tempFileDirectory) -
Method Summary
Modifier and TypeMethodDescriptionReturns anTempFileByteBuffer
that can be used to read the data that is contained in this stream.void
write
(byte[] b) Writes b.length bytes to the end ofTempFileByteBuffer
contained in this stream.void
write
(byte[] b, int off, int len) Writes len bytes to the end ofTempFileByteBuffer
contained in this stream starting from position off.void
write
(int b) Writes this byte to the end of theTempFileByteBuffer
contained in this stream.Methods inherited from class java.io.OutputStream
close, flush, nullOutputStream
-
Constructor Details
-
TempFileByteBufferOutputStream
public TempFileByteBufferOutputStream(int inMemoryBytes) - Parameters:
inMemoryBytes
- number of bytes to keep in memory before using a temp file
-
TempFileByteBufferOutputStream
- Parameters:
inMemoryBytes
- number of bytes to keep in memory before using a temp filetempFileDirectory
- directory to store temporary files in
-
TempFileByteBufferOutputStream
-
-
Method Details
-
write
Writes this byte to the end of theTempFileByteBuffer
contained in this stream.- Specified by:
write
in classOutputStream
- Throws:
IOException
- See Also:
-
write
Writes b.length bytes to the end ofTempFileByteBuffer
contained in this stream.- Overrides:
write
in classOutputStream
- Throws:
IOException
- See Also:
-
write
Writes len bytes to the end ofTempFileByteBuffer
contained in this stream starting from position off.- Overrides:
write
in classOutputStream
- Throws:
IOException
- See Also:
-
getBuffer
Returns anTempFileByteBuffer
that can be used to read the data that is contained in this stream.- Returns:
TempFileByteBuffer
-