Package com.saperion.common.io
Class TempFileByteBufferOutputStream
- java.lang.Object
-
- java.io.OutputStream
-
- com.saperion.common.io.TempFileByteBufferOutputStream
-
- All Implemented Interfaces:
java.io.Closeable,java.io.Flushable,java.lang.AutoCloseable
public class TempFileByteBufferOutputStream extends java.io.OutputStreamAnOutputStreamthat stores it's data in aTempFileByteBuffer.
-
-
Constructor Summary
Constructors Constructor Description TempFileByteBufferOutputStream(int inMemoryBytes)TempFileByteBufferOutputStream(int inMemoryBytes, java.io.File tempFileDirectory)TempFileByteBufferOutputStream(TempFileByteBuffer buffer)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TempFileByteBuffergetBuffer()Returns 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.
-
-
-
Constructor Detail
-
TempFileByteBufferOutputStream
public TempFileByteBufferOutputStream(int inMemoryBytes)
- Parameters:
inMemoryBytes- number of bytes to keep in memory before using a temp file
-
TempFileByteBufferOutputStream
public TempFileByteBufferOutputStream(int inMemoryBytes, java.io.File tempFileDirectory)- Parameters:
inMemoryBytes- number of bytes to keep in memory before using a temp filetempFileDirectory- directory to store temporary files in
-
TempFileByteBufferOutputStream
public TempFileByteBufferOutputStream(TempFileByteBuffer buffer)
-
-
Method Detail
-
write
public void write(int b) throws java.io.IOExceptionWrites this byte to the end of theTempFileByteBuffercontained in this stream.- Specified by:
writein classjava.io.OutputStream- Throws:
java.io.IOException- See Also:
OutputStream.write(int)
-
write
public void write(byte[] b) throws java.io.IOExceptionWrites b.length bytes to the end ofTempFileByteBuffercontained in this stream.- Overrides:
writein classjava.io.OutputStream- Throws:
java.io.IOException- See Also:
OutputStream.write(byte[])
-
write
public void write(byte[] b, int off, int len) throws java.io.IOExceptionWrites len bytes to the end ofTempFileByteBuffercontained in this stream starting from position off.- Overrides:
writein classjava.io.OutputStream- Throws:
java.io.IOException- See Also:
OutputStream.write(byte[], int, int)
-
getBuffer
public TempFileByteBuffer getBuffer()
Returns anTempFileByteBufferthat can be used to read the data that is contained in this stream.- Returns:
TempFileByteBuffer
-
-