mirror of
https://github.com/corda/corda.git
synced 2025-01-22 12:28:11 +00:00
Add the RandomAccessFile(File file, String mode) constructor
As per the Java API. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
This commit is contained in:
parent
18f6f7881a
commit
905ddfe613
@ -22,9 +22,16 @@ public class RandomAccessFile {
|
||||
public RandomAccessFile(String name, String mode)
|
||||
throws FileNotFoundException
|
||||
{
|
||||
file = new File(name);
|
||||
this(new File(name), mode);
|
||||
}
|
||||
|
||||
public RandomAccessFile(File file, String mode)
|
||||
throws FileNotFoundException
|
||||
{
|
||||
if (file == null) throw new NullPointerException();
|
||||
if (mode.equals("rw")) allowWrite = true;
|
||||
else if (! mode.equals("r")) throw new IllegalArgumentException();
|
||||
this.file = file;
|
||||
open();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user