Package nom.tam.util
Class ArrayOutputStream
java.lang.Object
java.io.OutputStream
java.io.FilterOutputStream
java.io.BufferedOutputStream
nom.tam.util.ArrayOutputStream
- All Implemented Interfaces:
Closeable
,Flushable
,AutoCloseable
,OutputWriter
- Direct Known Subclasses:
FitsOutputStream
Efficient writing of binary arrays to streams with custom binary encoding.
- Since:
- 1.16
- Author:
- Attila Kovacs
- See Also:
-
Constructor Summary
ConstructorDescriptionArrayOutputStream
(OutputStream o, int bufLength, OutputEncoder java2bin) Instantiates a new output stream for efficient array transactions. -
Method Summary
Modifier and TypeMethodDescriptionvoid
writeArray
(Object o) SeeArrayDataOutput.writeArray(Object)
for a contract of this method.Methods inherited from class java.io.BufferedOutputStream
flush, write, write
Methods inherited from class java.io.FilterOutputStream
close, write
Methods inherited from class java.io.OutputStream
nullOutputStream
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface nom.tam.util.OutputWriter
write, write
-
Constructor Details
-
ArrayOutputStream
Instantiates a new output stream for efficient array transactions.- Parameters:
o
- the underlying output streambufLength
- the buffer size in bytes.java2bin
- the conversion from Java arrays to the binary representation in the stream.
-
-
Method Details
-
writeArray
SeeArrayDataOutput.writeArray(Object)
for a contract of this method.- Parameters:
o
- an array ot any type.- Throws:
IllegalArgumentException
- if the argument is not an array or if it contains an element that is not supported for encoding.IOException
- if there was an IO error writing to the output.
-