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
IOException
public boolean isOpen()
true
if the file descriptor is open.public final int write(ByteBuffer buf, int pos, int limit) throws IOException
IOException
public final int writeAddress(long address, int pos, int limit) throws IOException
IOException
public final long writev(ByteBuffer[] buffers, int offset, int length, long maxBytesToWrite) throws IOException
IOException
public final long writevAddresses(long memoryAddress, int length) throws IOException
IOException
public final int read(ByteBuffer buf, int pos, int limit) throws IOException
IOException
public final int readAddress(long address, int pos, int limit) throws IOException
IOException
public static FileDescriptor from(String path) throws IOException
FileDescriptor
for the given path.IOException
public static FileDescriptor from(File file) throws IOException
FileDescriptor
for the given File
.IOException
public static FileDescriptor[] pipe() throws IOException
IOException
Copyright © 2008–2024 The Netty Project. All rights reserved.