public class FileDescriptor extends Object
FileDescriptor implementation which allows to wrap an int and provide a
FileDescriptor for it.| Constructor and Description |
|---|
FileDescriptor(int fd) |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Close the file descriptor.
|
boolean |
equals(Object o) |
static FileDescriptor |
from(File file)
Open a new
FileDescriptor for the given File. |
static FileDescriptor |
from(String path)
Open a new
FileDescriptor for the given path. |
int |
hashCode() |
int |
intValue()
Return the int value of the filedescriptor.
|
boolean |
isOpen()
Returns
true if the file descriptor is open. |
protected boolean |
markClosed() |
static FileDescriptor[] |
pipe() |
int |
read(ByteBuffer buf,
int pos,
int limit) |
int |
readAddress(long address,
int pos,
int limit) |
String |
toString() |
int |
write(ByteBuffer buf,
int pos,
int limit) |
int |
writeAddress(long address,
int pos,
int limit) |
long |
writev(ByteBuffer[] buffers,
int offset,
int length,
long maxBytesToWrite) |
long |
writevAddresses(long memoryAddress,
int length) |
public final int intValue()
protected boolean markClosed()
public void close()
throws IOException
IOExceptionpublic boolean isOpen()
true if the file descriptor is open.public final int write(ByteBuffer buf, int pos, int limit) throws IOException
IOExceptionpublic final int writeAddress(long address,
int pos,
int limit)
throws IOException
IOExceptionpublic final long writev(ByteBuffer[] buffers, int offset, int length, long maxBytesToWrite) throws IOException
IOExceptionpublic final long writevAddresses(long memoryAddress,
int length)
throws IOException
IOExceptionpublic final int read(ByteBuffer buf, int pos, int limit) throws IOException
IOExceptionpublic final int readAddress(long address,
int pos,
int limit)
throws IOException
IOExceptionpublic static FileDescriptor from(String path) throws IOException
FileDescriptor for the given path.IOExceptionpublic static FileDescriptor from(File file) throws IOException
FileDescriptor for the given File.IOExceptionpublic static FileDescriptor[] pipe() throws IOException
IOExceptionCopyright © 2008–2025 The Netty Project. All rights reserved.