org.jSyncManager.API.Protocol.Util.VFS
Class FileReference
java.lang.Objectorg.jSyncManager.API.Protocol.Util.VFS.FileReference
public class FileReference
extends java.lang.Object
A representation of a file reference for use with VFS on a device.
This class is used by nearly all VFS functions that do any sort of file I/O.
It provides a mechanism for identifying the file being worked on.
int | getFileReferenceAsInt()- Retreives the integer representing this file reference.
|
void | putToByteArray(byte[] buffer)- Puts the file reference into an array of bytes.
|
void | putToByteArray(byte[] buffer, int position)- Puts the file reference into an array of bytes.
|
OPEN_EXCLUSIVE_MODE_FLAG
public static final char OPEN_EXCLUSIVE_MODE_FLAG
A flag to denote that the file should be opened in Exclusive mode.
OPEN_READ_MODE_FLAG
public static final char OPEN_READ_MODE_FLAG
A flag to denote that the file should be opened for Read access.
OPEN_READ_WRITE_MODE_FLAG
public static final char OPEN_READ_WRITE_MODE_FLAG
A flag to denote that the file should be opened for Read/Write access.
OPEN_WRITE_MODE_FLAG
public static final char OPEN_WRITE_MODE_FLAG
A flag to denote that the file should be opened for Write access.
SEEK_ORIGIN_BEGINNING
public static final char SEEK_ORIGIN_BEGINNING
A flag to denote we wish to seek from the beginning of the file.
SEEK_ORIGIN_CURRENT_POSITION
public static final char SEEK_ORIGIN_CURRENT_POSITION
A flag to denote we wish to seek from the current position in the file.
SEEK_ORIGIN_END
public static final char SEEK_ORIGIN_END
A flag to denote we wish to seek from the end of the file.
VFS_FILE_ARCHIVE
public static final int VFS_FILE_ARCHIVE
A flag to denote that the file has the archive attribute set.
VFS_FILE_HIDDEN
public static final int VFS_FILE_HIDDEN
A flag to denote that the file is hidden.
VFS_FILE_IS_DIRECTORY
public static final int VFS_FILE_IS_DIRECTORY
A flag to denote that the file is a directory.
VFS_FILE_IS_LINK
public static final int VFS_FILE_IS_LINK
A flag to denote that the file is a link.
VFS_FILE_READ_ONLY
public static final int VFS_FILE_READ_ONLY
A flag to denote that the file is read only (or a directory).
VFS_FILE_SYSTEM
public static final int VFS_FILE_SYSTEM
A flag to denote that the file has the system attribute.
VFS_FILE_VOLUME_LABEL
public static final int VFS_FILE_VOLUME_LABEL
A flag to denote that the file is a volume label.
FileReference
public FileReference(int i)
Constructs a new file reference object.
i - the file reference number.
getFileReferenceAsInt
public int getFileReferenceAsInt()
Retreives the integer representing this file reference.
- the integer representing this file reference.
putToByteArray
public void putToByteArray(byte[] buffer)
Puts the file reference into an array of bytes.
This method puts the file reference into the specified array starting at index 0.
buffer - the byte array to write the file reference to.
putToByteArray
public void putToByteArray(byte[] buffer,
int position)Puts the file reference into an array of bytes.
buffer - the byte array to write the file reference to.position - the location to write to in the array.