public class ConcurrentFileEndpoint extends Object implements WritableByteChannel
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
isAbandoned |
protected CompletableFuture<Path> |
isDone |
protected Path |
path |
protected SeekableByteChannel |
writeChannel |
| Constructor and Description |
|---|
ConcurrentFileEndpoint(Path path,
SeekableByteChannel writeChannel) |
| Modifier and Type | Method and Description |
|---|---|
void |
abandon()
Only for the creating thread!
Indicate that the writing to the endpoint has been abandoned.
|
void |
close() |
static ConcurrentFileEndpoint |
create(Path path,
OpenOption... options) |
CompletableFuture<Path> |
getIsDone() |
Path |
getPath() |
boolean |
isAbandoned() |
boolean |
isOpen() |
static void |
main(String[] args) |
ReadableByteChannel |
newReadChannel() |
String |
toString() |
int |
write(ByteBuffer src) |
protected Path path
protected SeekableByteChannel writeChannel
protected boolean isAbandoned
protected CompletableFuture<Path> isDone
public ConcurrentFileEndpoint(Path path, SeekableByteChannel writeChannel)
public static ConcurrentFileEndpoint create(Path path, OpenOption... options) throws IOException
IOExceptionpublic Path getPath()
public boolean isAbandoned()
public void abandon()
public CompletableFuture<Path> getIsDone()
public void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableclose in interface ChannelIOExceptionpublic int write(ByteBuffer src) throws IOException
write in interface WritableByteChannelIOExceptionpublic ReadableByteChannel newReadChannel() throws IOException
IOExceptionpublic static void main(String[] args) throws IOException, InterruptedException
IOExceptionInterruptedExceptionCopyright © 2020. All rights reserved.