Package org.jppf.utils.streams
Class MultipleBuffersOutputStream
java.lang.Object
java.io.OutputStream
org.jppf.utils.streams.MultipleBuffersOutputStream
- All Implemented Interfaces:
Closeable,Flushable,AutoCloseable
An output stream implementation that minimizes memory usage.
- Author:
- Laurent Cohen
-
Constructor Summary
ConstructorsConstructorDescriptionInitialize this output stream with a default buffer length of 32768.MultipleBuffersOutputStream(List<JPPFBuffer> initialList) Initialize this output stream with a default buffer length of 32768. -
Method Summary
Modifier and TypeMethodDescriptionintsize()Get the size of the content of this output stream.Get the content of the output stream as a list ofJPPFBufferinstances.toString()voidwrite(byte[] b) Writes the specified byte array to this output stream.voidwrite(byte[] b, int off, int len) Writeslenbytes from the specified byte array starting at offsetoffto this output stream.voidwrite(int b) Write a single byte into this output stream.Methods inherited from class java.io.OutputStream
close, flush, nullOutputStream
-
Constructor Details
-
MultipleBuffersOutputStream
public MultipleBuffersOutputStream()Initialize this output stream with a default buffer length of 32768. -
MultipleBuffersOutputStream
Initialize this output stream with a default buffer length of 32768.- Parameters:
initialList- contains the data that is written to this output stream.
-
-
Method Details
-
write
Write a single byte into this output stream.- Specified by:
writein classOutputStream- Parameters:
b- the data to write.- Throws:
IOException- if any error occurs.
-
write
Writeslenbytes from the specified byte array starting at offsetoffto this output stream.- Overrides:
writein classOutputStream- Parameters:
b- the data.off- the start offset in the data.len- the number of bytes to write.- Throws:
IOException- if any error occurs.
-
write
Writes the specified byte array to this output stream.- Overrides:
writein classOutputStream- Parameters:
b- the data to write.- Throws:
IOException- if any error occurs.
-
size
public int size()Get the size of the content of this output stream.- Returns:
- the size as an int value.
-
toBufferList
Get the content of the output stream as a list ofJPPFBufferinstances.- Returns:
- a list of
JPPFBufferinstances.
-
toString
-