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 anTempFileByteBufferthat can be used to read the data that is contained in this stream.voidwrite(byte[] b) Writes b.length bytes to the end ofTempFileByteBuffercontained in this stream.voidwrite(byte[] b, int off, int len) Writes len bytes to the end ofTempFileByteBuffercontained in this stream starting from position off.voidwrite(int b) Writes this byte to the end of theTempFileByteBuffercontained 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 theTempFileByteBuffercontained in this stream.- Specified by:
writein classOutputStream- Throws:
IOException- See Also:
-
write
Writes b.length bytes to the end ofTempFileByteBuffercontained in this stream.- Overrides:
writein classOutputStream- Throws:
IOException- See Also:
-
write
Writes len bytes to the end ofTempFileByteBuffercontained in this stream starting from position off.- Overrides:
writein classOutputStream- Throws:
IOException- See Also:
-
getBuffer
Returns anTempFileByteBufferthat can be used to read the data that is contained in this stream.- Returns:
TempFileByteBuffer
-