|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.mines.jtk.io.ArrayInputAdapter
public class ArrayInputAdapter
Implements ArrayInput by wrapping DataInput.
This adapter wraps a specified data input to provide methods for reading
values and arrays of values with an optionally specified byte order.
Byte order should rarely be specified. Most applications should simply use the default BIG_ENDIAN byte order.
When an adapter is constructed from an object that has a file channel, the channel enables more efficient reads of arrays of values.
| Constructor Summary | |
|---|---|
ArrayInputAdapter(java.io.DataInput input)
Constructs an adapter for the specified data input. |
|
ArrayInputAdapter(java.io.DataInput input,
java.nio.ByteOrder order)
Constructs an adapter for the specified data input and byte order. |
|
ArrayInputAdapter(java.io.FileInputStream stream)
Constructs an adapter for the specified file input stream and byte order. |
|
ArrayInputAdapter(java.io.FileInputStream stream,
java.nio.ByteOrder order)
Constructs an adapter for the specified file input stream and byte order. |
|
ArrayInputAdapter(java.io.RandomAccessFile file)
Constructs an adapter for the specified random-access file. |
|
ArrayInputAdapter(java.io.RandomAccessFile file,
java.nio.ByteOrder order)
Constructs an adapter for the specified random-access file and byte order. |
|
ArrayInputAdapter(java.nio.channels.ReadableByteChannel channel,
java.io.DataInput input,
java.nio.ByteOrder order)
Constructs an adapter for the specified channel, input, and byte order. |
|
| Method Summary | |
|---|---|
java.nio.ByteOrder |
getByteOrder()
Gets the byte order for this adapter. |
boolean |
readBoolean()
|
byte |
readByte()
|
void |
readBytes(byte[] v)
Reads byte elements into a specified array. |
void |
readBytes(byte[][] v)
Reads byte elements into a specified array. |
void |
readBytes(byte[][][] v)
Reads byte elements into a specified array. |
void |
readBytes(byte[] v,
int k,
int n)
Reads byte elements into a specified array. |
char |
readChar()
|
void |
readChars(char[] v)
Reads char elements into a specified array. |
void |
readChars(char[][] v)
Reads char elements into a specified array. |
void |
readChars(char[][][] v)
Reads char elements into a specified array. |
void |
readChars(char[] v,
int k,
int n)
Reads char elements into a specified array. |
double |
readDouble()
|
void |
readDoubles(double[] v)
Reads double elements into a specified array. |
void |
readDoubles(double[][] v)
Reads double elements into a specified array. |
void |
readDoubles(double[][][] v)
Reads double elements into a specified array. |
void |
readDoubles(double[] v,
int k,
int n)
Reads double elements into a specified array. |
float |
readFloat()
|
void |
readFloats(float[] v)
Reads float elements into a specified array. |
void |
readFloats(float[][] v)
Reads float elements into a specified array. |
void |
readFloats(float[][][] v)
Reads float elements into a specified array. |
void |
readFloats(float[] v,
int k,
int n)
Reads float elements into a specified array. |
void |
readFully(byte[] b)
|
void |
readFully(byte[] b,
int off,
int len)
|
int |
readInt()
|
void |
readInts(int[] v)
Reads int elements into a specified array. |
void |
readInts(int[][] v)
Reads int elements into a specified array. |
void |
readInts(int[][][] v)
Reads int elements into a specified array. |
void |
readInts(int[] v,
int k,
int n)
Reads int elements into a specified array. |
java.lang.String |
readLine()
|
long |
readLong()
|
void |
readLongs(long[] v)
Reads long elements into a specified array. |
void |
readLongs(long[][] v)
Reads long elements into a specified array. |
void |
readLongs(long[][][] v)
Reads long elements into a specified array. |
void |
readLongs(long[] v,
int k,
int n)
Reads long elements into a specified array. |
short |
readShort()
|
void |
readShorts(short[] v)
Reads short elements into a specified array. |
void |
readShorts(short[][] v)
Reads short elements into a specified array. |
void |
readShorts(short[][][] v)
Reads short elements into a specified array. |
void |
readShorts(short[] v,
int k,
int n)
Reads short elements into a specified array. |
int |
readUnsignedByte()
|
int |
readUnsignedShort()
|
java.lang.String |
readUTF()
|
int |
skipBytes(int n)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ArrayInputAdapter(java.io.DataInput input)
input - the data input.public ArrayInputAdapter(java.io.RandomAccessFile file)
file - the random-access file.public ArrayInputAdapter(java.io.FileInputStream stream)
stream - the file input stream.
public ArrayInputAdapter(java.io.DataInput input,
java.nio.ByteOrder order)
input - the data input.order - the byte order.
public ArrayInputAdapter(java.io.RandomAccessFile file,
java.nio.ByteOrder order)
file - the random-access file.order - the byte order.
public ArrayInputAdapter(java.io.FileInputStream stream,
java.nio.ByteOrder order)
stream - the file input stream.order - the byte order.
public ArrayInputAdapter(java.nio.channels.ReadableByteChannel channel,
java.io.DataInput input,
java.nio.ByteOrder order)
channel - the readable byte channel; null, if none.input - the data input.order - the byte order.| Method Detail |
|---|
public java.nio.ByteOrder getByteOrder()
public void readFully(byte[] b)
throws java.io.IOException
readFully in interface ArrayInputreadFully in interface java.io.DataInputjava.io.IOException
public void readFully(byte[] b,
int off,
int len)
throws java.io.IOException
readFully in interface ArrayInputreadFully in interface java.io.DataInputjava.io.IOException
public int skipBytes(int n)
throws java.io.IOException
skipBytes in interface ArrayInputskipBytes in interface java.io.DataInputjava.io.IOException
public final boolean readBoolean()
throws java.io.IOException
readBoolean in interface ArrayInputreadBoolean in interface java.io.DataInputjava.io.IOException
public final byte readByte()
throws java.io.IOException
readByte in interface ArrayInputreadByte in interface java.io.DataInputjava.io.IOException
public final int readUnsignedByte()
throws java.io.IOException
readUnsignedByte in interface ArrayInputreadUnsignedByte in interface java.io.DataInputjava.io.IOException
public final short readShort()
throws java.io.IOException
readShort in interface ArrayInputreadShort in interface java.io.DataInputjava.io.IOException
public final int readUnsignedShort()
throws java.io.IOException
readUnsignedShort in interface ArrayInputreadUnsignedShort in interface java.io.DataInputjava.io.IOException
public final char readChar()
throws java.io.IOException
readChar in interface ArrayInputreadChar in interface java.io.DataInputjava.io.IOException
public final int readInt()
throws java.io.IOException
readInt in interface ArrayInputreadInt in interface java.io.DataInputjava.io.IOException
public final long readLong()
throws java.io.IOException
readLong in interface ArrayInputreadLong in interface java.io.DataInputjava.io.IOException
public final float readFloat()
throws java.io.IOException
readFloat in interface ArrayInputreadFloat in interface java.io.DataInputjava.io.IOException
public final double readDouble()
throws java.io.IOException
readDouble in interface ArrayInputreadDouble in interface java.io.DataInputjava.io.IOException
public final java.lang.String readLine()
throws java.io.IOException
readLine in interface ArrayInputreadLine in interface java.io.DataInputjava.io.IOException
public final java.lang.String readUTF()
throws java.io.IOException
readUTF in interface ArrayInputreadUTF in interface java.io.DataInputjava.io.IOException
public void readBytes(byte[] v,
int k,
int n)
throws java.io.IOException
readBytes in interface ArrayInputv - the array.k - the index of the first element to read.n - the number of elements to read.
java.io.IOException
public void readBytes(byte[] v)
throws java.io.IOException
readBytes in interface ArrayInputv - the array.
java.io.IOException
public void readBytes(byte[][] v)
throws java.io.IOException
readBytes in interface ArrayInputv - the array.
java.io.IOException
public void readBytes(byte[][][] v)
throws java.io.IOException
readBytes in interface ArrayInputv - the array.
java.io.IOException
public void readChars(char[] v,
int k,
int n)
throws java.io.IOException
readChars in interface ArrayInputv - the array.k - the index of the first element to read.n - the number of elements to read.
java.io.IOException
public void readChars(char[] v)
throws java.io.IOException
readChars in interface ArrayInputv - the array.
java.io.IOException
public void readChars(char[][] v)
throws java.io.IOException
readChars in interface ArrayInputv - the array.
java.io.IOException
public void readChars(char[][][] v)
throws java.io.IOException
readChars in interface ArrayInputv - the array.
java.io.IOException
public void readShorts(short[] v,
int k,
int n)
throws java.io.IOException
readShorts in interface ArrayInputv - the array.k - the index of the first element to read.n - the number of elements to read.
java.io.IOException
public void readShorts(short[] v)
throws java.io.IOException
readShorts in interface ArrayInputv - the array.
java.io.IOException
public void readShorts(short[][] v)
throws java.io.IOException
readShorts in interface ArrayInputv - the array.
java.io.IOException
public void readShorts(short[][][] v)
throws java.io.IOException
readShorts in interface ArrayInputv - the array.
java.io.IOException
public void readInts(int[] v,
int k,
int n)
throws java.io.IOException
readInts in interface ArrayInputv - the array.k - the index of the first element to read.n - the number of elements to read.
java.io.IOException
public void readInts(int[] v)
throws java.io.IOException
readInts in interface ArrayInputv - the array.
java.io.IOException
public void readInts(int[][] v)
throws java.io.IOException
readInts in interface ArrayInputv - the array.
java.io.IOException
public void readInts(int[][][] v)
throws java.io.IOException
readInts in interface ArrayInputv - the array.
java.io.IOException
public void readLongs(long[] v,
int k,
int n)
throws java.io.IOException
readLongs in interface ArrayInputv - the array.k - the index of the first element to read.n - the number of elements to read.
java.io.IOException
public void readLongs(long[] v)
throws java.io.IOException
readLongs in interface ArrayInputv - the array.
java.io.IOException
public void readLongs(long[][] v)
throws java.io.IOException
readLongs in interface ArrayInputv - the array.
java.io.IOException
public void readLongs(long[][][] v)
throws java.io.IOException
readLongs in interface ArrayInputv - the array.
java.io.IOException
public void readFloats(float[] v,
int k,
int n)
throws java.io.IOException
readFloats in interface ArrayInputv - the array.k - the index of the first element to read.n - the number of elements to read.
java.io.IOException
public void readFloats(float[] v)
throws java.io.IOException
readFloats in interface ArrayInputv - the array.
java.io.IOException
public void readFloats(float[][] v)
throws java.io.IOException
readFloats in interface ArrayInputv - the array.
java.io.IOException
public void readFloats(float[][][] v)
throws java.io.IOException
readFloats in interface ArrayInputv - the array.
java.io.IOException
public void readDoubles(double[] v,
int k,
int n)
throws java.io.IOException
readDoubles in interface ArrayInputv - the array.k - the index of the first element to read.n - the number of elements to read.
java.io.IOException
public void readDoubles(double[] v)
throws java.io.IOException
readDoubles in interface ArrayInputv - the array.
java.io.IOException
public void readDoubles(double[][] v)
throws java.io.IOException
readDoubles in interface ArrayInputv - the array.
java.io.IOException
public void readDoubles(double[][][] v)
throws java.io.IOException
readDoubles in interface ArrayInputv - the array.
java.io.IOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||