|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.groovyj.filesystem.Filesystem.File
Filesystem.File is a class containing all the operations you can do to a file in the Filesystem.
Method Summary | |
void |
delete()
Deletes this file entirely. |
int |
getFilePointer()
Get the file pointer, in bytes, of this file. |
long |
getOffset()
Get the offset at which this file begins. |
int |
length()
Get the length, in bytes, of this file. |
byte[] |
read(int len)
Read an amount of bytes starting at the file pointer, and return an array filled with the bytes read. |
void |
seek(int offset)
Move the file pointer to the given byte offset in this file. |
void |
truncate()
Truncates this file at the file pointer. |
void |
write(byte[] data)
Write the given data to the file at the file pointer. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Method Detail |
public long getOffset()
public int length()
public int getFilePointer()
public void seek(int offset) throws java.io.IOException
offset
- the byte offset into the file to which to move the file
pointer.public void write(byte[] data) throws java.io.IOException
data
- an array of bytes which will be written to this file.public byte[] read(int len) throws java.io.IOException
len
- the number of bytes to read.public void delete() throws java.io.IOException
public void truncate() throws java.io.IOException
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |