public class File
extends java.lang.Object
Modifier and Type | Field | Description |
---|---|---|
static int |
SEEK_CUR |
|
static int |
SEEK_END |
|
static int |
SEEK_SET |
Constructor | Description |
---|---|
File(java.lang.String path) |
Constructor, opens the file.
|
Modifier and Type | Method | Description |
---|---|---|
void |
close() |
Close the file.
|
static void |
nativeInit() |
Class initializer, to initialize various JNI stuff
|
protected void |
open(java.lang.String path) |
Opens the file whose name is the string pointed to by path.
|
long |
read(long size,
long nMemb) |
Read elements of a file.
|
void |
seek(long offset,
long origin) |
Write elements into a file.
|
long |
write(long size,
long nMemb) |
Write elements into a file.
|
public static final int SEEK_SET
public static final int SEEK_CUR
public static final int SEEK_END
public File(java.lang.String path)
path
- is the file location on the storageprotected void open(java.lang.String path)
path
- is the file location on the storagepublic long read(long size, long nMemb)
size
- of each elementnMemb
- is the number of elements of data to writepublic long write(long size, long nMemb)
size
- of each elementnMemb
- is the number of elements of data to writepublic void seek(long offset, long origin)
offset
- : number of bytes to offset from originorigin
- : Position used as reference for the offset. It is specified by one of the following constants
defined in <stdio.h> exclusively to be used as arguments for this function (SEEK_SET =
beginning of file, SEEK_CUR = current position of the file pointer, SEEK_END = end of file)public void close()
public static void nativeInit()