|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectuk.ac.starlink.fits.BufferedRandomInput
public class BufferedRandomInput
BasicInput implementation based on a RandomAccessFile. Buffering of the underlying file is performed on the assumption that access will be largely sequential.
| Field Summary | |
|---|---|
static int |
DFLT_BUFSIZE
|
| Constructor Summary | |
|---|---|
BufferedRandomInput(java.io.RandomAccessFile file,
long offset0)
Constructs a BufferedRandomInput with a default sized buffer. |
|
BufferedRandomInput(java.io.RandomAccessFile file,
long offset0,
int bufsize)
Constructs a BufferedRandomInput with a buffer of specified size. |
|
| Method Summary | |
|---|---|
void |
close()
Releases resources belonging to this object. |
long |
getOffset()
Returns the curent position in this stream (optional operation). |
boolean |
isRandom()
Indicates whether this object supports random access. |
byte |
readByte()
Reads a byte from the stream. |
double |
readDouble()
Reads an 8-byte floating point value from the stream. |
float |
readFloat()
Reads a 4-byte floating point value from the stream. |
int |
readInt()
Reads a 4-byte integer from the stream. |
long |
readLong()
Reads an 8-byte integer from the stream. |
short |
readShort()
Reads a 2-byte integer from the stream. |
void |
seek(long offset)
Moves the current position of this stream to a given byte offset (optional operation). |
void |
skip(long nbytes)
Skips a given number of bytes forwards through the stream. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int DFLT_BUFSIZE
| Constructor Detail |
|---|
public BufferedRandomInput(java.io.RandomAccessFile file,
long offset0)
throws java.io.IOException
file - fileoffset0 - offset into file of stream start
java.io.IOException
public BufferedRandomInput(java.io.RandomAccessFile file,
long offset0,
int bufsize)
throws java.io.IOException
file - fileoffset0 - offset into file of stream startbufsize - buffer size
java.io.IOException| Method Detail |
|---|
public byte readByte()
throws java.io.IOException
BasicInput
readByte in interface BasicInputjava.io.IOException
public short readShort()
throws java.io.IOException
BasicInput
readShort in interface BasicInputjava.io.IOException
public int readInt()
throws java.io.IOException
BasicInput
readInt in interface BasicInputjava.io.IOException
public long readLong()
throws java.io.IOException
BasicInput
readLong in interface BasicInputjava.io.IOException
public float readFloat()
throws java.io.IOException
BasicInput
readFloat in interface BasicInputjava.io.IOException
public double readDouble()
throws java.io.IOException
BasicInput
readDouble in interface BasicInputjava.io.IOExceptionpublic boolean isRandom()
BasicInput
isRandom in interface BasicInput
public void skip(long nbytes)
throws java.io.IOException
BasicInput
skip in interface BasicInputnbytes - number of bytes to skip
java.io.IOExceptionpublic long getOffset()
BasicInput
getOffset in interface BasicInput
public void seek(long offset)
throws java.io.IOException
BasicInput
seek in interface BasicInputjava.io.IOException
public void close()
throws java.io.IOException
BasicInput
close in interface BasicInputjava.io.IOException
|
Copyright © 2004 CLRC: Central Laboratory of the Research Councils. All rights reserved. | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||