|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectucar.unidata.io.RandomAccessFile
ucar.unidata.io.http.HTTPRandomAccessFile
public class HTTPRandomAccessFile
Gives access to files over HTTP, using jakarta commons HttpClient library. This version uses a single instance of HttpClient, following performance guidelines at http://jakarta.apache.org/commons/httpclient/performance.html Plus other improvements.
| Field Summary | |
|---|---|
static int |
defaultHTTPBufferSize
|
| Fields inherited from class ucar.unidata.io.RandomAccessFile |
|---|
BIG_ENDIAN, bigEndian, buffer, bufferStart, dataEnd, dataSize, debugAccess, debugLeaks, defaultBufferSize, endOfFile, file, fileChannel, filePosition, LITTLE_ENDIAN, location, openFiles, readonly, showOpen |
| Constructor Summary | |
|---|---|
HTTPRandomAccessFile(java.lang.String url)
|
|
HTTPRandomAccessFile(java.lang.String url,
int bufferSize)
|
|
| Method Summary | |
|---|---|
static org.apache.commons.httpclient.HttpClient |
getHttpClient()
Get the HttpClient object - a single instance is used. |
long |
length()
Get the length of the file. |
protected int |
read_(long pos,
byte[] buff,
int offset,
int len)
Read directly from file, without going through the buffer. |
long |
readToByteChannel(java.nio.channels.WritableByteChannel dest,
long offset,
long nbytes)
Read nbytes bytes, at the specified file offset, send to a WritableByteChannel. |
static void |
setHttpClient(org.apache.commons.httpclient.HttpClient client)
Set the HttpClient object - a single instance is used. |
| Methods inherited from class ucar.unidata.io.RandomAccessFile |
|---|
close, flush, getBufferSize, getDebugLeaks, getFD, getFilePointer, getLocation, getOpenFiles, getRandomAccessFile, isAtEndOfFile, order, read, read, read, readBoolean, readBuffer, readByte, readBytes, readBytes, readChar, readDouble, readDouble, readFloat, readFloat, readFully, readFully, readInt, readInt, readIntUnbuffered, readLine, readLong, readLong, readShort, readShort, readString, readUnsignedByte, readUnsignedShort, readUTF, searchForward, seek, setBufferSize, setDebugAccess, setDebugLeaks, setExtendMode, setMinLength, skipBytes, toString, unread, write, write, write, writeBoolean, writeBoolean, writeByte, writeBytes, writeBytes, writeBytes, writeChar, writeChar, writeChars, writeDouble, writeDouble, writeFloat, writeFloat, writeInt, writeInt, writeLong, writeLong, writeShort, writeShort, writeUTF |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static int defaultHTTPBufferSize
| Constructor Detail |
|---|
public HTTPRandomAccessFile(java.lang.String url)
throws java.io.IOException
java.io.IOException
public HTTPRandomAccessFile(java.lang.String url,
int bufferSize)
throws java.io.IOException
java.io.IOException| Method Detail |
|---|
public static void setHttpClient(org.apache.commons.httpclient.HttpClient client)
client - the HttpClient objectpublic static org.apache.commons.httpclient.HttpClient getHttpClient()
protected int read_(long pos,
byte[] buff,
int offset,
int len)
throws java.io.IOException
read_ in class RandomAccessFilepos - start here in the filebuff - put data into this bufferoffset - buffer offsetlen - this number of bytes
java.io.IOException - on io error
public long readToByteChannel(java.nio.channels.WritableByteChannel dest,
long offset,
long nbytes)
throws java.io.IOException
RandomAccessFilenbytes bytes, at the specified file offset, send to a WritableByteChannel.
This will block until all bytes are read.
This uses the underlying file channel directly, bypassing all user buffers.
readToByteChannel in class RandomAccessFiledest - write to this WritableByteChannel.offset - the offset in the file where copying will start.nbytes - the number of bytes to read.
java.io.IOException - if an I/O error occurs.
public long length()
throws java.io.IOException
RandomAccessFile
length in class RandomAccessFilejava.io.IOException - if an I/O error occurrs.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||