Package nom.tam.util
Interface InputReader
- All Known Subinterfaces:
ArrayDataInput
,RandomAccess
,RandomAccessFileIO
,ReadWriteAccess
- All Known Implementing Classes:
ArrayDataFile
,ArrayInputStream
,BufferedDataInputStream
,BufferedFile
,ByteArrayIO
,FitsFile
,FitsInputStream
public interface InputReader
Interface for asic binary input reading functionality.
- Since:
- 1.16
- Author:
- Attila Kovacs
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionstatic InputReader
from
(InputStream i) Wraps an input stream with this interface.int
read()
Reads a byte.int
read
(byte[] b, int from, int length) Reads up to the specified number of bytes into a buffer.
-
Method Details
-
read
Reads a byte. See the general contract ofFilterInputStream.read()
.- Returns:
- the (unsigned) byte value or -1 if there is nothing left to read.
- Throws:
IOException
- if there was an underlying IO error- See Also:
-
read
Reads up to the specified number of bytes into a buffer. See the general contract ofDataInputStream.read(byte[], int, int)
.- Parameters:
b
- the bufferfrom
- the starting buffer indexlength
- the number of bytes to read.- Returns:
- the number of bytes actually read, or -1 if there is nothing left to read.
- Throws:
IOException
- if there was an underlying IO error- See Also:
-
from
Wraps an input stream with this interface.- Parameters:
i
- any input stream- Returns:
- the stream wrapped to this interface
-