|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.io.InputStream
org.openstreetmap.osmosis.core.store.BufferedRandomAccessFileInputStream
public class BufferedRandomAccessFileInputStream
Wraps a random access file adding buffered input stream capabilities. This allows a file to be randomly accessed while providing performance improvements over the non-buffered random access file implementation.
| Constructor Summary | |
|---|---|
BufferedRandomAccessFileInputStream(java.io.File file)
Creates a new instance. |
|
BufferedRandomAccessFileInputStream(java.io.File file,
int bufferCount,
int initialBufferSize,
int maxBufferSize,
float bufferIncreaseFactor)
Creates a new instance. |
|
| Method Summary | |
|---|---|
void |
close()
|
long |
length()
Returns the length of the data file. |
long |
position()
Returns the current read position in the data file. |
int |
read()
|
int |
read(byte[] b)
|
int |
read(byte[] b,
int off,
int len)
|
void |
seek(long pos)
Seeks to the specified position in the file. |
| Methods inherited from class java.io.InputStream |
|---|
available, mark, markSupported, reset, skip |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public BufferedRandomAccessFileInputStream(java.io.File file)
throws java.io.FileNotFoundException
file - The file to be read.
java.io.FileNotFoundException - if the file cannot be opened.
public BufferedRandomAccessFileInputStream(java.io.File file,
int bufferCount,
int initialBufferSize,
int maxBufferSize,
float bufferIncreaseFactor)
throws java.io.FileNotFoundException
file - The file to be read.bufferCount - The number of buffers to use. Use of multiple buffers allows
some random seeks to occur without losing existing buffered
data that might be returned to.initialBufferSize - After a seek, this is the number of bytes that will be
initially read.maxBufferSize - This is the maximum number of bytes that will ever be read
from the underlying file at a time.bufferIncreaseFactor - During sequential reads, if the buffer is exhausted the next
read will be longer than the previous read according to this
factor. A value of 1 means the buffer never gets larger. The
buffer will never get larger than maxBufferSize.
java.io.FileNotFoundException - if the file cannot be opened.| Method Detail |
|---|
public int read()
throws java.io.IOException
read in class java.io.InputStreamjava.io.IOException
public int read(byte[] b)
throws java.io.IOException
read in class java.io.InputStreamjava.io.IOException
public int read(byte[] b,
int off,
int len)
throws java.io.IOException
read in class java.io.InputStreamjava.io.IOException
public void seek(long pos)
throws java.io.IOException
pos - The position within the file to seek to.
java.io.IOException - if an error occurs during seeking.
public long length()
throws java.io.IOException
java.io.IOException - if an error occurs during the length operation.
public long position()
throws java.io.IOException
java.io.IOException - if an error occurs during the position operation.
public void close()
throws java.io.IOException
close in interface java.io.Closeableclose in class java.io.InputStreamjava.io.IOException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||