|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectswisseph.FilePtr
public class FilePtr
This class is meant to be a wrapper to some read functionality of the RandomAccessFile class. It adds the ability to read (and search and seek) in files using http://... access. This is needed to allow applets read access to files, in this case the Swiss Ephemeris and JPL data files.
| Field Summary | |
|---|---|
static java.lang.String |
useragent
|
| Constructor Summary | |
|---|---|
FilePtr(java.io.RandomAccessFile fp,
java.net.Socket sk,
java.io.InputStream is,
java.io.BufferedOutputStream os,
java.lang.String fnamp,
long fileLength,
int bufsize)
Creates a new FilePtr instance. |
|
| Method Summary | |
|---|---|
void |
close()
Closes the connection to the file. |
long |
getFilePointer()
Returns the current position of the file pointer. |
long |
length()
Returns the length of the file. |
byte |
readByte()
Reads one (signed) byte. |
double |
readDouble()
Reads a double value. |
int |
readInt()
Reads a (signed) integer value. |
java.lang.String |
readLine()
Reads a complete line from the file. |
short |
readShort()
Reads a (signed) short value. |
int |
readUnsignedByte()
Reads one unsigned byte. |
void |
seek(long pos)
Positions the file pointer. |
void |
setBigendian(boolean bigendian)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String useragent
| Constructor Detail |
|---|
public FilePtr(java.io.RandomAccessFile fp,
java.net.Socket sk,
java.io.InputStream is,
java.io.BufferedOutputStream os,
java.lang.String fnamp,
long fileLength,
int bufsize)
throws java.io.IOException
java.io.IOException| Method Detail |
|---|
public void setBigendian(boolean bigendian)
public byte readByte()
throws java.io.IOException,
java.io.EOFException
java.io.IOException - if an I/O error occurs.
java.io.EOFException - if the end of file is reached before the
byte could be read.
public int readUnsignedByte()
throws java.io.IOException,
java.io.EOFException
java.io.IOException - if an I/O error occurs.
java.io.EOFException - if the end of file is reached before the
byte could be read.
public short readShort()
throws java.io.IOException,
java.io.EOFException
java.io.IOException - if an I/O error occurs.
java.io.EOFException - if the end of file is reached before the
2 bytes could be read completely.
public int readInt()
throws java.io.IOException,
java.io.EOFException
java.io.IOException - if an I/O error occurs.
java.io.EOFException - if the end of file is reached before the
4 bytes could be read completely.
public double readDouble()
throws java.io.IOException,
java.io.EOFException
java.io.IOException - if an I/O error occurs.
java.io.EOFException - if the end of file is reached before the
8 bytes could be read completely.
public java.lang.String readLine()
throws java.io.IOException,
java.io.EOFException
java.io.IOException - if an I/O error occurs.
java.io.EOFException - if the end of file is reached before even one
character (byte) could be read.
public void close()
throws java.io.IOException
java.io.IOException - if an I/O error occurs.public long getFilePointer()
public long length()
throws java.io.IOException
java.io.IOException - if an I/O error occurs.public void seek(long pos)
pos - the new position in the file. The position is seen zero based.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||