Package nom.tam.util
Class ArrayInputStream
java.lang.Object
java.io.InputStream
java.io.FilterInputStream
java.io.BufferedInputStream
nom.tam.util.ArrayInputStream
- All Implemented Interfaces:
Closeable
,AutoCloseable
,InputReader
- Direct Known Subclasses:
FitsInputStream
Efficient reading of binary arrays from streams with custom binary encoding.
- Since:
- 1.16
- Author:
- Attila Kovacs
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionvoid
SeeArrayDataInput.readArrayFully(Object)
for a contract of this method.void
LikereadArrayFully(Object)
but strictly for numerical types only.long
readLArray
(Object o) SeeArrayDataInput.readLArray(Object)
for a contract of this method.Methods inherited from class java.io.BufferedInputStream
available, close, mark, markSupported, read, read, reset, skip
Methods inherited from class java.io.FilterInputStream
read
Methods inherited from class java.io.InputStream
nullInputStream, readAllBytes, readNBytes, readNBytes, skipNBytes, transferTo
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface nom.tam.util.InputReader
read, read
-
Method Details
-
readLArray
SeeArrayDataInput.readLArray(Object)
for a contract of this method.- Parameters:
o
- an array, to be populated- Returns:
- the actual number of bytes read from the input, or -1 if already at the end-of-file.
- Throws:
IllegalArgumentException
- if the argument is not an array or if it contains an element that is not supported for decoding.IOException
- if there was an IO error reading from the input- See Also:
-
readArrayFully
SeeArrayDataInput.readArrayFully(Object)
for a contract of this method.- Parameters:
o
- an array, to be populated- Throws:
IllegalArgumentException
- if the argument is not an array or if it contains an element that is not supported for decoding.IOException
- if there was an IO error reading from the input- See Also:
-
readImage
LikereadArrayFully(Object)
but strictly for numerical types only.- Parameters:
o
- An any-dimensional array containing only numerical types- Throws:
IllegalArgumentException
- if the argument is not an array or if it contains an element that is not supported.EOFException
- if already at the end of file.IOException
- if there was an IO error- Since:
- 1.18
- See Also:
-