public class File4D extends RandomAccessStream implements FileStates
| Modifier and Type | Field and Description |
|---|---|
static int |
ATTR_ARCHIVE |
static int |
ATTR_HIDDEN |
static int |
ATTR_READ_ONLY |
static int |
ATTR_SYSTEM |
static int |
CLOSED |
protected java.lang.String |
path |
static byte |
TIME_ACCESSED |
static byte |
TIME_ALL |
static byte |
TIME_CREATED |
static byte |
TIME_MODIFIED |
static java.lang.String[] |
winceVols |
pos, SEEK_CUR, SEEK_END, SEEK_SETskipBufferCREATE, CREATE_EMPTY, DONT_OPEN, INVALID, READ_ONLY, READ_WRITE| Constructor and Description |
|---|
File4D(java.lang.String path) |
File4D(java.lang.String path,
int mode) |
File4D(java.lang.String path,
int mode,
int slot) |
| Modifier and Type | Method and Description |
|---|---|
int |
chmod(int mod) |
void |
close()
Closes this I/O connection, releasing any associated resources.
|
static void |
copy(java.lang.String src,
java.lang.String dst) |
void |
copyTo(File dest) |
void |
createDir() |
void |
delete() |
static void |
deleteDir(java.lang.String dir) |
boolean |
exists() |
protected void |
finalize() |
void |
flush() |
int |
getAttributes() |
static java.lang.String |
getCardSerialNumber(int slot) |
static File |
getCardVolume() |
File |
getParent() |
java.lang.String |
getPath() |
int |
getPos()
Returns the current offset in this stream.
|
int |
getSize() |
int |
getSlot() |
Time |
getTime(byte whichTime) |
static boolean |
isCardInserted(int slot) |
boolean |
isDir() |
boolean |
isEmpty() |
java.lang.String[] |
listFiles() |
static java.lang.String[] |
listFiles(java.lang.String dir) |
static java.lang.String[] |
listFiles(java.lang.String dir,
boolean recursive) |
static java.lang.String[] |
listRoots() |
static void |
move(java.lang.String src,
java.lang.String dst) |
void |
moveTo(File dest) |
byte[] |
read()
Deprecated.
|
byte[] |
readAndClose()
Deprecated.
|
byte[] |
readAndDelete()
Deprecated.
|
int |
readBytes(byte[] b,
int off,
int len)
Reads bytes from the stream.
|
void |
rename(java.lang.String path) |
void |
setAttributes(int attr) |
void |
setPos(int pos)
Sets the file pointer for read and write operations to the given position.
|
void |
setPos(int offset,
int origin)
Sets the file pointer for read and write operations to a new position defined by adding offset to a reference
position specified by origin.
|
void |
setSize(int newSize) |
void |
setTime(byte whichTime,
Time time) |
void |
writeAndClose(byte[] bytes)
Deprecated.
|
int |
writeBytes(byte[] b,
int off,
int len)
Writes bytes to the stream.
|
asInputStream, asOutputStream, asStream, asStream, skipBytes, wrapInputStream, wrapInputStreamToStream, write, writeBytes, writeBytes, writeBytesprotected java.lang.String path
public static final int CLOSED
public static final byte TIME_ALL
public static final byte TIME_CREATED
public static final byte TIME_MODIFIED
public static final byte TIME_ACCESSED
public static final int ATTR_ARCHIVE
public static final int ATTR_HIDDEN
public static final int ATTR_READ_ONLY
public static final int ATTR_SYSTEM
public static java.lang.String[] winceVols
public File4D(java.lang.String path,
int mode,
int slot)
throws IllegalArgumentIOException,
FileNotFoundException,
IOException
public File4D(java.lang.String path,
int mode)
throws IllegalArgumentIOException,
FileNotFoundException,
IOException
public File4D(java.lang.String path)
throws IllegalArgumentIOException,
IOException
public void close()
throws IOException
close in interface java.io.Closeableclose in interface java.lang.AutoCloseableIOException - If an I/O error occurs.public java.lang.String getPath()
public int getPos()
throws IOException
RandomAccessStreamgetPos in class RandomAccessStreamIOException - if an I/O error has occurred.public void setPos(int offset,
int origin)
throws IOException
RandomAccessStreamsetPos in class RandomAccessStreamoffset - number of bytes to offset from origin.origin - position from where offset is added. It is specified by one of the SEEK_* constants.IOException - if the new position is negative or if an I/O error occurs.public static boolean isCardInserted(int slot)
throws IllegalArgumentIOException
IllegalArgumentIOExceptionpublic void createDir()
throws IOException
IOExceptionpublic void delete()
throws FileNotFoundException,
IOException
FileNotFoundExceptionIOExceptionpublic boolean exists()
throws IOException
IOExceptionpublic int getSize()
throws IOException
IOExceptionpublic boolean isDir()
throws IOException
IOExceptionpublic java.lang.String[] listFiles()
throws IOException
IOExceptionpublic int readBytes(byte[] b,
int off,
int len)
throws IOException
StreamreadBytes in class Streamb - the byte array to read data intooff - the start position in the arraylen - the number of bytes to readIOExceptionpublic void rename(java.lang.String path)
throws IllegalArgumentIOException,
IOException
public void setPos(int pos)
throws IOException
RandomAccessStreamsetPos in class RandomAccessStreampos - the offset position, measured in bytes from the beginning of the file, at which to set the file pointer.IOException - if pos is negative or if an I/O error occurs.public int writeBytes(byte[] b,
int off,
int len)
throws IOException
StreamIOException if an error prevented the write
operation from occurring.writeBytes in class Streamb - the byte array to write data fromoff - the start position in the byte arraylen - the number of bytes to writeIOExceptionpublic void setAttributes(int attr)
throws IllegalArgumentIOException,
IOException
public int getAttributes()
throws IOException
IOExceptionpublic void setTime(byte whichTime,
Time time)
throws IllegalArgumentIOException,
IOException
public Time getTime(byte whichTime) throws IllegalArgumentIOException, IOException
public void setSize(int newSize)
throws IOException
IOExceptionpublic static java.lang.String getCardSerialNumber(int slot)
throws IllegalArgumentIOException,
IOException
public boolean isEmpty()
throws IOException
IOExceptionpublic File getParent() throws IOException
IOExceptionpublic static File getCardVolume() throws IOException
IOExceptionpublic void flush()
throws IOException
IOExceptionprotected void finalize()
finalize in class java.lang.Objectpublic int getSlot()
public static java.lang.String[] listFiles(java.lang.String dir)
throws IOException
IOExceptionpublic static java.lang.String[] listFiles(java.lang.String dir,
boolean recursive)
throws IOException
IOExceptionpublic static void deleteDir(java.lang.String dir)
throws IOException
IOExceptionpublic static java.lang.String[] listRoots()
public void copyTo(File dest) throws IOException
IOExceptionpublic void moveTo(File dest) throws IOException
IOExceptionpublic int chmod(int mod)
throws IOException
IOExceptionpublic static void copy(java.lang.String src,
java.lang.String dst)
throws IOException
IOExceptionpublic static void move(java.lang.String src,
java.lang.String dst)
throws IOException
IOException@Deprecated
public byte[] readAndClose()
throws IOException
IOException@Deprecated
public byte[] readAndDelete()
throws IOException
IOException@Deprecated
public byte[] read()
throws IOException
IOException@Deprecated
public void writeAndClose(byte[] bytes)
throws IOException
IOException