public abstract class AbstractArrayDataIO extends Object implements ArrayDataInput, ArrayDataOutput
nom.tam.util-compatible FITS I/O handler.
The ArrayDataInput interface contains a lot of methods declared like
int read(type[]) throws IOException;
whose behaviour is not documented - when do they throw an exception
and what do they return? The behaviour implemented here follows that
of the BufferedFile implementation (which is similarly
undocumented). It is as follows:
BufferedFile implementation for more details.| Constructor and Description |
|---|
AbstractArrayDataIO() |
| Modifier and Type | Method and Description |
|---|---|
protected abstract byte |
get()
Reads one byte from the current position.
|
protected abstract void |
get(byte[] buf,
int offset,
int length)
Reads bytes into a buffer from the current position.
|
abstract long |
length()
Returns the size of this buffer.
|
protected abstract void |
put(byte b)
Writes a single byte at the current position.
|
protected abstract void |
put(byte[] buf,
int offset,
int length)
Writes bytes from a buffer to the current position.
|
int |
read(boolean[] buf) |
int |
read(boolean[] buf,
int start,
int length) |
int |
read(byte[] buf) |
int |
read(byte[] buf,
int start,
int length) |
int |
read(char[] buf) |
int |
read(char[] buf,
int start,
int length) |
int |
read(double[] buf) |
int |
read(double[] buf,
int start,
int length) |
int |
read(float[] buf) |
int |
read(float[] buf,
int start,
int length) |
int |
read(int[] buf) |
int |
read(int[] buf,
int start,
int length) |
int |
read(long[] buf) |
int |
read(long[] buf,
int start,
int length) |
int |
read(short[] buf) |
int |
read(short[] buf,
int start,
int length) |
int |
readArray(Object o)
Read a generic (possibly multidimenionsional) primitive array.
|
boolean |
readBoolean() |
byte |
readByte() |
char |
readChar() |
double |
readDouble() |
float |
readFloat() |
void |
readFully(byte[] buf) |
void |
readFully(byte[] buf,
int start,
int len)
Reads a specified number of bytes into an array.
|
int |
readInt() |
long |
readLArray(Object o) |
String |
readLine()
Deprecated.
|
long |
readLong() |
short |
readShort() |
int |
readUnsignedByte() |
int |
readUnsignedShort() |
String |
readUTF() |
protected abstract long |
remaining()
Returns the number of bytes remaining between the current position
and the end of the file.
|
void |
write(boolean[] buf) |
void |
write(boolean[] buf,
int start,
int length) |
void |
write(byte[] buf) |
void |
write(byte[] buf,
int start,
int length) |
void |
write(char[] buf) |
void |
write(char[] buf,
int start,
int length) |
void |
write(double[] buf) |
void |
write(double[] buf,
int start,
int length) |
void |
write(float[] buf) |
void |
write(float[] buf,
int start,
int length) |
void |
write(int val) |
void |
write(int[] buf) |
void |
write(int[] buf,
int start,
int length) |
void |
write(long[] buf) |
void |
write(long[] buf,
int start,
int length) |
void |
write(short[] buf) |
void |
write(short[] buf,
int start,
int length) |
void |
write(String[] strings) |
void |
write(String[] strings,
int start,
int length) |
void |
writeArray(Object o)
Write a generic (possibly multi-dimenionsional) primitive or String
array.
|
void |
writeBoolean(boolean val) |
void |
writeByte(int val) |
void |
writeBytes(String s) |
void |
writeChar(int val) |
void |
writeChars(String s) |
void |
writeDouble(double val) |
void |
writeFloat(float val) |
void |
writeInt(int val) |
void |
writeLong(long val) |
void |
writeShort(int val) |
void |
writeUTF(String str) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitclose, skipclose, flushprotected abstract byte get()
throws IOException
IOExceptionprotected abstract void get(byte[] buf,
int offset,
int length)
throws IOException
buf - destination bufferoffset - offset of first byte in buf to be writtenlength - maximum number of bytes to be written to
bufIOExceptionprotected abstract void put(byte b)
throws IOException
b - output byteIOExceptionprotected abstract void put(byte[] buf,
int offset,
int length)
throws IOException
buf - source bufferoffset - offset of first byte in buf to be readlength - number of bytes from buf to be readIOExceptionpublic abstract long length()
protected abstract long remaining()
Long.MAX_VALUE;public boolean readBoolean()
throws IOException
readBoolean in interface DataInputIOExceptionpublic byte readByte()
throws IOException
readByte in interface DataInputIOExceptionpublic short readShort()
throws IOException
readShort in interface DataInputIOExceptionpublic char readChar()
throws IOException
readChar in interface DataInputIOExceptionpublic int readInt()
throws IOException
readInt in interface DataInputIOExceptionpublic long readLong()
throws IOException
readLong in interface DataInputIOExceptionpublic float readFloat()
throws IOException
readFloat in interface DataInputIOExceptionpublic double readDouble()
throws IOException
readDouble in interface DataInputIOExceptionpublic int readUnsignedByte()
throws IOException
readUnsignedByte in interface DataInputIOExceptionpublic int readUnsignedShort()
throws IOException
readUnsignedShort in interface DataInputIOExceptionpublic String readUTF() throws IOException
readUTF in interface DataInputIOException@Deprecated public String readLine() throws IOException
DataInputStream.readLine()readLine in interface DataInputUnsupportedOperationException - alwaysIOExceptionpublic void readFully(byte[] buf,
int start,
int len)
throws IOException
readFully in interface DataInputbuf - the byte buffer into which to readstart - the index in buf at which to start putting byteslen - the number of bytes which must be readEOFException - if there are fewer than len bytes leftIOExceptionpublic int read(byte[] buf,
int start,
int length)
throws IOException
read in interface ArrayDataInputIOExceptionpublic int read(boolean[] buf,
int start,
int length)
throws IOException
read in interface ArrayDataInputIOExceptionpublic int read(short[] buf,
int start,
int length)
throws IOException
read in interface ArrayDataInputIOExceptionpublic int read(char[] buf,
int start,
int length)
throws IOException
read in interface ArrayDataInputIOExceptionpublic int read(int[] buf,
int start,
int length)
throws IOException
read in interface ArrayDataInputIOExceptionpublic int read(long[] buf,
int start,
int length)
throws IOException
read in interface ArrayDataInputIOExceptionpublic int read(float[] buf,
int start,
int length)
throws IOException
read in interface ArrayDataInputIOExceptionpublic int read(double[] buf,
int start,
int length)
throws IOException
read in interface ArrayDataInputIOExceptionpublic void readFully(byte[] buf)
throws IOException
readFully in interface DataInputIOExceptionpublic int read(byte[] buf)
throws IOException
read in interface ArrayDataInputIOExceptionpublic int read(boolean[] buf)
throws IOException
read in interface ArrayDataInputIOExceptionpublic int read(short[] buf)
throws IOException
read in interface ArrayDataInputIOExceptionpublic int read(char[] buf)
throws IOException
read in interface ArrayDataInputIOExceptionpublic int read(int[] buf)
throws IOException
read in interface ArrayDataInputIOExceptionpublic int read(long[] buf)
throws IOException
read in interface ArrayDataInputIOExceptionpublic int read(float[] buf)
throws IOException
read in interface ArrayDataInputIOExceptionpublic int read(double[] buf)
throws IOException
read in interface ArrayDataInputIOExceptionpublic int readArray(Object o) throws IOException
ArrayDataInputThe ArrayDataInput classes do not support String input since it is unclear how one would read in an Array of strings.
readArray in interface ArrayDataInputo - A [multidimensional] primitive (or Object) array.IOExceptionpublic long readLArray(Object o) throws IOException
IOExceptionpublic void write(int val)
throws IOException
write in interface DataOutputIOExceptionpublic void writeBoolean(boolean val)
throws IOException
writeBoolean in interface DataOutputIOExceptionpublic void writeByte(int val)
throws IOException
writeByte in interface DataOutputIOExceptionpublic void writeShort(int val)
throws IOException
writeShort in interface DataOutputIOExceptionpublic void writeChar(int val)
throws IOException
writeChar in interface DataOutputIOExceptionpublic void writeInt(int val)
throws IOException
writeInt in interface DataOutputIOExceptionpublic void writeLong(long val)
throws IOException
writeLong in interface DataOutputIOExceptionpublic void writeFloat(float val)
throws IOException
writeFloat in interface DataOutputIOExceptionpublic void writeDouble(double val)
throws IOException
writeDouble in interface DataOutputIOExceptionpublic void write(byte[] buf,
int start,
int length)
throws IOException
write in interface DataOutputwrite in interface ArrayDataOutputIOExceptionpublic void write(boolean[] buf,
int start,
int length)
throws IOException
write in interface ArrayDataOutputIOExceptionpublic void write(short[] buf,
int start,
int length)
throws IOException
write in interface ArrayDataOutputIOExceptionpublic void write(char[] buf,
int start,
int length)
throws IOException
write in interface ArrayDataOutputIOExceptionpublic void write(int[] buf,
int start,
int length)
throws IOException
write in interface ArrayDataOutputIOExceptionpublic void write(long[] buf,
int start,
int length)
throws IOException
write in interface ArrayDataOutputIOExceptionpublic void write(float[] buf,
int start,
int length)
throws IOException
write in interface ArrayDataOutputIOExceptionpublic void write(double[] buf,
int start,
int length)
throws IOException
write in interface ArrayDataOutputIOExceptionpublic void write(String[] strings, int start, int length) throws IOException
write in interface ArrayDataOutputIOExceptionpublic void writeBytes(String s) throws IOException
writeBytes in interface DataOutputIOExceptionpublic void writeChars(String s) throws IOException
writeChars in interface DataOutputIOExceptionpublic void writeUTF(String str) throws IOException
writeUTF in interface DataOutputIOExceptionpublic void write(byte[] buf)
throws IOException
write in interface DataOutputwrite in interface ArrayDataOutputIOExceptionpublic void write(boolean[] buf)
throws IOException
write in interface ArrayDataOutputIOExceptionpublic void write(short[] buf)
throws IOException
write in interface ArrayDataOutputIOExceptionpublic void write(char[] buf)
throws IOException
write in interface ArrayDataOutputIOExceptionpublic void write(int[] buf)
throws IOException
write in interface ArrayDataOutputIOExceptionpublic void write(long[] buf)
throws IOException
write in interface ArrayDataOutputIOExceptionpublic void write(float[] buf)
throws IOException
write in interface ArrayDataOutputIOExceptionpublic void write(double[] buf)
throws IOException
write in interface ArrayDataOutputIOExceptionpublic void write(String[] strings) throws IOException
write in interface ArrayDataOutputIOExceptionpublic void writeArray(Object o) throws IOException
ArrayDataOutputThis routine is not called 'write' to avoid possible compilation errors in routines which define only some of the other methods of the interface (and defer to the superclass on others). In that case there is an ambiguity as to whether to call the routine in the current class but convert to Object, or call the method from the super class with the same type argument.
writeArray in interface ArrayDataOutputo - The primitive or String array to be written.IOException - if the argument is not of the proper typeCopyright © 2025 Central Laboratory of the Research Councils. All Rights Reserved.