public class SpyRandomAccessStream extends RandomAccessStream
| Constructor and Description |
|---|
SpyRandomAccessStream(RandomAccessStream file) |
| Modifier and Type | Method and Description |
|---|---|
void |
closeImpl()
Closes the stream.
|
long |
getFilePointer()
Returns the current position of the file pointer.
|
java.io.InputStream |
getInputStream()
Returns an InputStream for this stream.
|
long |
getLength()
Returns the length.
|
java.io.OutputStream |
getOutputStream()
Returns an OutputStream for this stream.
|
int |
read()
Read a byte from the file, advancing the pointer.
|
int |
read(byte[] buffer,
int offset,
int length)
Reads a block from a given location.
|
int |
read(char[] buffer,
int offset,
int length)
Reads a block from a given location.
|
int |
read(long fileOffset,
byte[] buffer,
int offset,
int length)
Reads a block from a given location.
|
boolean |
seek(long position)
Seeks to the given position in the file.
|
void |
write(byte[] buffer,
int offset,
int length)
Writes a block starting from the current file pointer.
|
void |
write(int b)
Write a byte to the file, advancing the pointer.
|
void |
write(long fileOffset,
byte[] buffer,
int offset,
int length)
Writes a block from a given location.
|
allocate, close, free, fsync, getMmapAddress, getUseCount, isMmap, isOpen, lock, unlock, writeToStreampublic SpyRandomAccessStream(RandomAccessStream file)
public long getLength()
throws java.io.IOException
getLength in class RandomAccessStreamjava.io.IOExceptionpublic int read(byte[] buffer,
int offset,
int length)
throws java.io.IOException
read in class RandomAccessStreamjava.io.IOExceptionpublic int read(char[] buffer,
int offset,
int length)
throws java.io.IOException
read in class RandomAccessStreamjava.io.IOExceptionpublic int read(long fileOffset,
byte[] buffer,
int offset,
int length)
throws java.io.IOException
read in class RandomAccessStreamjava.io.IOExceptionpublic void write(byte[] buffer,
int offset,
int length)
throws java.io.IOException
RandomAccessStreamwrite in class RandomAccessStreamjava.io.IOExceptionpublic void write(long fileOffset,
byte[] buffer,
int offset,
int length)
throws java.io.IOException
write in class RandomAccessStreamjava.io.IOExceptionpublic boolean seek(long position)
seek in class RandomAccessStreampublic java.io.OutputStream getOutputStream()
throws java.io.IOException
getOutputStream in class RandomAccessStreamjava.io.IOExceptionpublic java.io.InputStream getInputStream()
throws java.io.IOException
getInputStream in class RandomAccessStreamjava.io.IOExceptionpublic int read()
throws java.io.IOException
read in class RandomAccessStreamjava.io.IOExceptionpublic void write(int b)
throws java.io.IOException
write in class RandomAccessStreamjava.io.IOExceptionpublic long getFilePointer()
throws java.io.IOException
getFilePointer in class RandomAccessStreamjava.io.IOExceptionpublic void closeImpl()
throws java.io.IOException
closeImpl in class RandomAccessStreamjava.io.IOException