public class OpenFile extends OpenHandle
path| Constructor and Description |
|---|
OpenFile(java.nio.file.Path path,
java.util.Set<? extends java.nio.file.OpenOption> options,
java.nio.file.attribute.FileAttribute<?>... attrs) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
canBeDeleted()
Test via acquiring a FileLock if we can delete this file.
|
void |
close() |
void |
flush() |
boolean |
isRegularFile() |
int |
read(com.sun.jna.Pointer buf,
long num,
long offset)
Reads up to
num bytes beginning at offset into buf |
java.lang.String |
toString() |
void |
truncate(long size) |
int |
write(com.sun.jna.Pointer buf,
long num,
long offset)
Writes up to
num bytes from buf from offset into the current file |
public OpenFile(java.nio.file.Path path,
java.util.Set<? extends java.nio.file.OpenOption> options,
java.nio.file.attribute.FileAttribute<?>... attrs)
throws java.io.IOException
java.io.IOExceptionpublic int read(com.sun.jna.Pointer buf,
long num,
long offset)
throws java.io.IOException
num bytes beginning at offset into bufbuf - Buffernum - Number of bytes to readoffset - Position of first byte to readsize if reached EOF).java.io.IOException - If an exception occurs during read.public int write(com.sun.jna.Pointer buf,
long num,
long offset)
throws java.io.IOException
num bytes from buf from offset into the current filebuf - Buffernum - Number of bytes to writeoffset - Position of first byte to write atjava.io.IOException - If an exception occurs during write.public void close()
throws java.io.IOException
close in interface java.io.Closeableclose in interface java.lang.AutoCloseableclose in class OpenHandlejava.io.IOExceptionpublic boolean isRegularFile()
isRegularFile in class OpenHandlepublic void flush()
throws java.io.IOException
java.io.IOExceptionpublic void truncate(long size)
throws java.io.IOException
java.io.IOExceptionpublic boolean canBeDeleted()
public java.lang.String toString()
toString in class java.lang.ObjectCopyright © 2018. All rights reserved.