public final class RandomAccessFileOperations extends Object implements org.jdtaus.core.io.FileOperations
RandomAccessFile
to FileOperations
.Constructor and Description |
---|
RandomAccessFileOperations(RandomAccessFile file)
Creates a new
RandomAccessFileOperations instance adapting
file . |
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes the
RandomAccessFile backing the instance. |
long |
getFilePointer() |
long |
getLength() |
RandomAccessFile |
getRandomAccessFile()
Gets the random access file operations are performed with.
|
int |
read(byte[] buf,
int off,
int len) |
void |
read(OutputStream out) |
void |
setFilePointer(long pos) |
void |
setLength(long newLength) |
void |
write(byte[] buf,
int off,
int len) |
void |
write(InputStream in) |
public RandomAccessFileOperations(RandomAccessFile file)
RandomAccessFileOperations
instance adapting
file
.file
- an RandomAccessFile
instance to use as a
FileOperations
implementation.NullPointerException
- if file
is null
.public long getLength() throws IOException
getLength
in interface org.jdtaus.core.io.FileOperations
IOException
public void setLength(long newLength) throws IOException
setLength
in interface org.jdtaus.core.io.FileOperations
IOException
public long getFilePointer() throws IOException
getFilePointer
in interface org.jdtaus.core.io.FileOperations
IOException
public void setFilePointer(long pos) throws IOException
setFilePointer
in interface org.jdtaus.core.io.FileOperations
IOException
public void write(byte[] buf, int off, int len) throws IOException
write
in interface org.jdtaus.core.io.FileOperations
IOException
public int read(byte[] buf, int off, int len) throws IOException
read
in interface org.jdtaus.core.io.FileOperations
IOException
public void read(OutputStream out) throws IOException
read
in interface org.jdtaus.core.io.FileOperations
IOException
public void write(InputStream in) throws IOException
write
in interface org.jdtaus.core.io.FileOperations
IOException
public void close() throws IOException
RandomAccessFile
backing the instance.close
in interface org.jdtaus.core.io.FileOperations
IOException
- if closing the RandomAccessFile
backing the
instance fails.public RandomAccessFile getRandomAccessFile()
RandomAccessFile
instance operations are performed
with or null
.Copyright © 2005-2012 jDTAUS. All Rights Reserved.