public class FileDescriptor
extends java.lang.Object
FileDescriptor
实现允许包装int
并为其提供FileDescriptor
。
Constructor and Description |
---|
FileDescriptor(int fd) |
Modifier and Type | Method and Description |
---|---|
void |
close()
关闭文件描述符。
|
boolean |
equals(java.lang.Object o) |
static FileDescriptor |
from(java.io.File file)
打开一个新 FileDescriptor 为给定File 。
|
static FileDescriptor |
from(java.lang.String path)
为给定路径打开一个新的 FileDescriptor 。
|
int |
hashCode() |
int |
intValue()
返回filedescriptor的int值。
|
boolean |
isOpen()
如果文件描述符已打开,则返回
true 。
|
static FileDescriptor[] |
pipe() |
int |
read(java.nio.ByteBuffer buf, int pos, int limit) |
int |
readAddress(long address, int pos, int limit) |
java.lang.String |
toString() |
int |
write(java.nio.ByteBuffer buf, int pos, int limit) |
int |
writeAddress(long address, int pos, int limit) |
long |
writev(java.nio.ByteBuffer[] buffers, int offset, int length, long maxBytesToWrite) |
long |
writevAddresses(long memoryAddress, int length) |
public final int intValue()
public void close() throws java.io.IOException
java.io.IOException
public boolean isOpen()
true
。
public final int write(java.nio.ByteBuffer buf, int pos, int limit) throws java.io.IOException
java.io.IOException
public final int writeAddress(long address, int pos, int limit) throws java.io.IOException
java.io.IOException
public final long writev(java.nio.ByteBuffer[] buffers, int offset, int length, long maxBytesToWrite) throws java.io.IOException
java.io.IOException
public final long writevAddresses(long memoryAddress, int length) throws java.io.IOException
java.io.IOException
public final int read(java.nio.ByteBuffer buf, int pos, int limit) throws java.io.IOException
java.io.IOException
public final int readAddress(long address, int pos, int limit) throws java.io.IOException
java.io.IOException
public java.lang.String toString()
toString
在课堂上
java.lang.Object
public boolean equals(java.lang.Object o)
equals
在课程
java.lang.Object
public int hashCode()
hashCode
,课时
java.lang.Object
public static FileDescriptor from(java.lang.String path) throws java.io.IOException
FileDescriptor
。
java.io.IOException
public static FileDescriptor from(java.io.File file) throws java.io.IOException
FileDescriptor
为给定File
。
java.io.IOException
public static FileDescriptor[] pipe() throws java.io.IOException
java.io.IOException
Copyright © 2008–2018 The Netty Project. All rights reserved.