-
Notifications
You must be signed in to change notification settings - Fork 64
Expand file tree
/
Copy pathjava-channel-AsynchronousFileChannel.java
More file actions
31 lines (24 loc) · 1.25 KB
/
java-channel-AsynchronousFileChannel.java
File metadata and controls
31 lines (24 loc) · 1.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
-----------------------------------
AsynchronousFileChannel |
-----------------------------------
# 文件异步读写通道
# 构造
* 通过静态方法
AsynchronousFileChannel open(Path file,Set<? extends OpenOption> options,ExecutorService executor, FileAttribute<?>... attrs);
AsynchronousFileChannel open(Path file, OpenOption... options)
# 静态方法
AsynchronousFileChannel open(Path file,Set<? extends OpenOption> options,ExecutorService executor, FileAttribute<?>... attrs);
AsynchronousFileChannel open(Path file, OpenOption... options)
# 实例方法
long size();
AsynchronousFileChannel truncate(long size);
void force(boolean metaData);
void lock(A attachment,CompletionHandler<FileLock,? super A> handler);
void lock(long position,long size, boolean shared,A attachment,CompletionHandler<FileLock,? super A> handler);
Future<FileLock> lock(long position, long size, boolean shared);
Future<FileLock> lock();
FileLock tryLock();
void read(ByteBuffer dst,long position,A attachment,CompletionHandler<Integer,? super A> handler);
Future<Integer> read(ByteBuffer dst, long position);
void write(ByteBuffer src,long position,A attachment,CompletionHandler<Integer,? super A> handler);
Future<Integer> write(ByteBuffer src, long position);