Class FileDescriptor
java.lang.Object
io.netty.channel.unix.FileDescriptor
- Direct Known Subclasses:
Socket
Native
FileDescriptor implementation which allows to wrap an int and provide a
FileDescriptor for it.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Close the file descriptor.booleanstatic FileDescriptorOpen a newFileDescriptorfor the givenFile.static FileDescriptorOpen a newFileDescriptorfor the given path.inthashCode()final intintValue()Return the int value of the filedescriptor.booleanisOpen()Returnstrueif the file descriptor is open.protected booleanstatic FileDescriptor[]pipe()final intread(ByteBuffer buf, int pos, int limit) final intreadAddress(long address, int pos, int limit) toString()final intwrite(ByteBuffer buf, int pos, int limit) final intwriteAddress(long address, int pos, int limit) final longwritev(ByteBuffer[] buffers, int offset, int length, long maxBytesToWrite) final longwritevAddresses(long memoryAddress, int length)
-
Constructor Details
-
FileDescriptor
public FileDescriptor(int fd)
-
-
Method Details
-
intValue
public final int intValue()Return the int value of the filedescriptor. -
markClosed
protected boolean markClosed() -
close
-
isOpen
public boolean isOpen()Returnstrueif the file descriptor is open. -
write
- Throws:
IOException
-
writeAddress
- Throws:
IOException
-
writev
public final long writev(ByteBuffer[] buffers, int offset, int length, long maxBytesToWrite) throws IOException - Throws:
IOException
-
writevAddresses
- Throws:
IOException
-
read
- Throws:
IOException
-
readAddress
- Throws:
IOException
-
toString
-
equals
-
hashCode
-
from
Open a newFileDescriptorfor the given path.- Throws:
IOException
-
from
Open a newFileDescriptorfor the givenFile.- Throws:
IOException
-
pipe
- Returns:
- [0] = read end, [1] = write end
- Throws:
IOException
-