public class TwoBitRandomAccessFile
extends java.lang.Object
implements java.lang.AutoCloseable
| Constructor and Description |
|---|
TwoBitRandomAccessFile(java.io.File file)
Opens the given File as a read/write RandomAccessFile
|
TwoBitRandomAccessFile(java.io.File file,
int numTwoBits)
Opens the given File as a read/write RandomAccessFile with a capacity for the given number of two-bit data items.
|
TwoBitRandomAccessFile(java.lang.String filename)
Opens the File of the given filename as a read/write RandomAccessFile
|
TwoBitRandomAccessFile(java.lang.String filename,
int numTwoBits)
Opens the File of the given filename as a read/write RandomAccessFile with a capacity for the given number of two-bit data items.
|
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
Set all two-bit file positions to value 0.
|
void |
close()
Close the two-bit random access file.
|
int |
get(long pos)
Get and return the unsigned two-bit value at the given two-bit file position.
|
void |
set(long pos,
int val)
Set the given two-bit file position to the given unsigned two-bit value.
|
public TwoBitRandomAccessFile(java.io.File file)
throws java.io.FileNotFoundException
file - given Filejava.io.FileNotFoundExceptionpublic TwoBitRandomAccessFile(java.lang.String filename)
throws java.io.FileNotFoundException
filename - given filenamejava.io.FileNotFoundExceptionpublic TwoBitRandomAccessFile(java.io.File file,
int numTwoBits)
throws java.io.IOException
file - given FilenumTwoBits - the given number of two-bit data itemsjava.io.IOExceptionpublic TwoBitRandomAccessFile(java.lang.String filename,
int numTwoBits)
throws java.io.IOException
filename - given filenamenumTwoBits - the given number of two-bit data itemsjava.io.IOExceptionpublic void set(long pos,
int val)
throws java.io.IOException
pos - two-bit file positionval - unsigned two-bit valuejava.io.IOExceptionpublic int get(long pos)
throws java.io.IOException
pos - two-bit file positionjava.io.IOExceptionpublic void clear()
throws java.io.IOException
java.io.IOExceptionpublic void close()
throws java.lang.Exception
close in interface java.lang.AutoCloseablejava.lang.Exception