public abstract class AbstractArrayDataIO
extends java.lang.Object
implements nom.tam.util.ArrayDataInput, nom.tam.util.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.BITS_OF_1_BYTE, BITS_OF_2_BYTES, BITS_OF_3_BYTES, BITS_OF_4_BYTES, BITS_OF_5_BYTES, BITS_OF_6_BYTES, BITS_OF_7_BYTES, BYTE_1_OF_LONG_MASK, BYTE_2_OF_LONG_MASK, BYTE_3_OF_LONG_MASK, BYTE_4_OF_LONG_MASK, BYTE_MASK, BYTES_IN_BOOLEAN, BYTES_IN_BYTE, BYTES_IN_CHAR, BYTES_IN_DOUBLE, BYTES_IN_FLOAT, BYTES_IN_INTEGER, BYTES_IN_LONG, BYTES_IN_SHORT, DEFAULT_BUFFER_SIZE, HIGH_INTEGER_MASK, INTEGER_MASK, SHORT_MASK, SHORT_OF_LONG_MASK
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(java.lang.Object o) |
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(java.lang.Object o) |
java.lang.String |
readLine()
Deprecated.
see
DataInputStream.readLine() |
long |
readLong() |
short |
readShort() |
int |
readUnsignedByte() |
int |
readUnsignedShort() |
java.lang.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(java.lang.String[] strings) |
void |
write(java.lang.String[] strings,
int start,
int length) |
void |
writeArray(java.lang.Object o) |
void |
writeBoolean(boolean val) |
void |
writeByte(int val) |
void |
writeBytes(java.lang.String s) |
void |
writeChar(int val) |
void |
writeChars(java.lang.String s) |
void |
writeDouble(double val) |
void |
writeFloat(float val) |
void |
writeInt(int val) |
void |
writeLong(long val) |
void |
writeShort(int val) |
void |
writeUTF(java.lang.String str) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
protected abstract byte get() throws java.io.IOException
java.io.IOException
protected abstract void get(byte[] buf, int offset, int length) throws java.io.IOException
buf
- destination bufferoffset
- offset of first byte in buf
to be writtenlength
- maximum number of bytes to be written to
buf
java.io.IOException
protected abstract void put(byte b) throws java.io.IOException
b
- output bytejava.io.IOException
protected abstract void put(byte[] buf, int offset, int length) throws java.io.IOException
buf
- source bufferoffset
- offset of first byte in buf
to be readlength
- number of bytes from buf
to be readjava.io.IOException
public abstract long length()
protected abstract long remaining()
Long.MAX_VALUE
;public boolean readBoolean() throws java.io.IOException
readBoolean
in interface java.io.DataInput
java.io.IOException
public byte readByte() throws java.io.IOException
readByte
in interface java.io.DataInput
java.io.IOException
public short readShort() throws java.io.IOException
readShort
in interface java.io.DataInput
java.io.IOException
public char readChar() throws java.io.IOException
readChar
in interface java.io.DataInput
java.io.IOException
public int readInt() throws java.io.IOException
readInt
in interface java.io.DataInput
java.io.IOException
public long readLong() throws java.io.IOException
readLong
in interface java.io.DataInput
java.io.IOException
public float readFloat() throws java.io.IOException
readFloat
in interface java.io.DataInput
java.io.IOException
public double readDouble() throws java.io.IOException
readDouble
in interface java.io.DataInput
java.io.IOException
public int readUnsignedByte() throws java.io.IOException
readUnsignedByte
in interface java.io.DataInput
java.io.IOException
public int readUnsignedShort() throws java.io.IOException
readUnsignedShort
in interface java.io.DataInput
java.io.IOException
public java.lang.String readUTF() throws java.io.IOException
readUTF
in interface java.io.DataInput
java.io.IOException
public java.lang.String readLine() throws java.io.IOException
DataInputStream.readLine()
readLine
in interface java.io.DataInput
java.lang.UnsupportedOperationException
java.io.IOException
public void readFully(byte[] buf, int start, int len) throws java.io.IOException
readFully
in interface java.io.DataInput
readFully
in interface nom.tam.util.ArrayDataInput
buf
- the byte buffer into which to readstart
- the index in buf at which to start putting byteslen
- the number of bytes which must be readjava.io.EOFException
- if there are fewer than len bytes leftjava.io.IOException
public int read(byte[] buf, int start, int length) throws java.io.IOException
read
in interface nom.tam.util.ArrayDataInput
java.io.IOException
public int read(boolean[] buf, int start, int length) throws java.io.IOException
read
in interface nom.tam.util.ArrayDataInput
java.io.IOException
public int read(short[] buf, int start, int length) throws java.io.IOException
read
in interface nom.tam.util.ArrayDataInput
java.io.IOException
public int read(char[] buf, int start, int length) throws java.io.IOException
read
in interface nom.tam.util.ArrayDataInput
java.io.IOException
public int read(int[] buf, int start, int length) throws java.io.IOException
read
in interface nom.tam.util.ArrayDataInput
java.io.IOException
public int read(long[] buf, int start, int length) throws java.io.IOException
read
in interface nom.tam.util.ArrayDataInput
java.io.IOException
public int read(float[] buf, int start, int length) throws java.io.IOException
read
in interface nom.tam.util.ArrayDataInput
java.io.IOException
public int read(double[] buf, int start, int length) throws java.io.IOException
read
in interface nom.tam.util.ArrayDataInput
java.io.IOException
public void readFully(byte[] buf) throws java.io.IOException
readFully
in interface java.io.DataInput
java.io.IOException
public int read(byte[] buf) throws java.io.IOException
read
in interface nom.tam.util.ArrayDataInput
java.io.IOException
public int read(boolean[] buf) throws java.io.IOException
read
in interface nom.tam.util.ArrayDataInput
java.io.IOException
public int read(short[] buf) throws java.io.IOException
read
in interface nom.tam.util.ArrayDataInput
java.io.IOException
public int read(char[] buf) throws java.io.IOException
read
in interface nom.tam.util.ArrayDataInput
java.io.IOException
public int read(int[] buf) throws java.io.IOException
read
in interface nom.tam.util.ArrayDataInput
java.io.IOException
public int read(long[] buf) throws java.io.IOException
read
in interface nom.tam.util.ArrayDataInput
java.io.IOException
public int read(float[] buf) throws java.io.IOException
read
in interface nom.tam.util.ArrayDataInput
java.io.IOException
public int read(double[] buf) throws java.io.IOException
read
in interface nom.tam.util.ArrayDataInput
java.io.IOException
public int readArray(java.lang.Object o) throws java.io.IOException
readArray
in interface nom.tam.util.ArrayDataInput
java.io.IOException
public long readLArray(java.lang.Object o) throws java.io.IOException
readLArray
in interface nom.tam.util.ArrayDataInput
java.io.IOException
public void write(int val) throws java.io.IOException
write
in interface java.io.DataOutput
java.io.IOException
public void writeBoolean(boolean val) throws java.io.IOException
writeBoolean
in interface java.io.DataOutput
java.io.IOException
public void writeByte(int val) throws java.io.IOException
writeByte
in interface java.io.DataOutput
java.io.IOException
public void writeShort(int val) throws java.io.IOException
writeShort
in interface java.io.DataOutput
java.io.IOException
public void writeChar(int val) throws java.io.IOException
writeChar
in interface java.io.DataOutput
java.io.IOException
public void writeInt(int val) throws java.io.IOException
writeInt
in interface java.io.DataOutput
java.io.IOException
public void writeLong(long val) throws java.io.IOException
writeLong
in interface java.io.DataOutput
java.io.IOException
public void writeFloat(float val) throws java.io.IOException
writeFloat
in interface java.io.DataOutput
java.io.IOException
public void writeDouble(double val) throws java.io.IOException
writeDouble
in interface java.io.DataOutput
java.io.IOException
public void write(byte[] buf, int start, int length) throws java.io.IOException
write
in interface java.io.DataOutput
java.io.IOException
public void write(boolean[] buf, int start, int length) throws java.io.IOException
write
in interface nom.tam.util.ArrayDataOutput
java.io.IOException
public void write(short[] buf, int start, int length) throws java.io.IOException
write
in interface nom.tam.util.ArrayDataOutput
java.io.IOException
public void write(char[] buf, int start, int length) throws java.io.IOException
write
in interface nom.tam.util.ArrayDataOutput
java.io.IOException
public void write(int[] buf, int start, int length) throws java.io.IOException
write
in interface nom.tam.util.ArrayDataOutput
java.io.IOException
public void write(long[] buf, int start, int length) throws java.io.IOException
write
in interface nom.tam.util.ArrayDataOutput
java.io.IOException
public void write(float[] buf, int start, int length) throws java.io.IOException
write
in interface nom.tam.util.ArrayDataOutput
java.io.IOException
public void write(double[] buf, int start, int length) throws java.io.IOException
write
in interface nom.tam.util.ArrayDataOutput
java.io.IOException
public void write(java.lang.String[] strings, int start, int length) throws java.io.IOException
write
in interface nom.tam.util.ArrayDataOutput
java.io.IOException
public void writeBytes(java.lang.String s) throws java.io.IOException
writeBytes
in interface java.io.DataOutput
java.io.IOException
public void writeChars(java.lang.String s) throws java.io.IOException
writeChars
in interface java.io.DataOutput
java.io.IOException
public void writeUTF(java.lang.String str) throws java.io.IOException
writeUTF
in interface java.io.DataOutput
java.io.IOException
public void write(byte[] buf) throws java.io.IOException
write
in interface java.io.DataOutput
java.io.IOException
public void write(boolean[] buf) throws java.io.IOException
write
in interface nom.tam.util.ArrayDataOutput
java.io.IOException
public void write(short[] buf) throws java.io.IOException
write
in interface nom.tam.util.ArrayDataOutput
java.io.IOException
public void write(char[] buf) throws java.io.IOException
write
in interface nom.tam.util.ArrayDataOutput
java.io.IOException
public void write(int[] buf) throws java.io.IOException
write
in interface nom.tam.util.ArrayDataOutput
java.io.IOException
public void write(long[] buf) throws java.io.IOException
write
in interface nom.tam.util.ArrayDataOutput
java.io.IOException
public void write(float[] buf) throws java.io.IOException
write
in interface nom.tam.util.ArrayDataOutput
java.io.IOException
public void write(double[] buf) throws java.io.IOException
write
in interface nom.tam.util.ArrayDataOutput
java.io.IOException
public void write(java.lang.String[] strings) throws java.io.IOException
write
in interface nom.tam.util.ArrayDataOutput
java.io.IOException
public void writeArray(java.lang.Object o) throws java.io.IOException
writeArray
in interface nom.tam.util.ArrayDataOutput
java.io.IOException
Copyright © 2017 Central Laboratory of the Research Councils. All Rights Reserved.