public final class AzureSeekableByteChannel extends Object implements SeekableByteChannel
A channel may only be opened in read mode OR write mode. It may not be opened in read/write mode. Seeking is supported for reads, but not for writes. Modifications to existing files is not permitted--only creating new files or overwriting existing files.
This type is not threadsafe to prevent having to hold locks across network calls.
Modifier and Type | Method and Description |
---|---|
void |
close() |
boolean |
isOpen() |
long |
position() |
AzureSeekableByteChannel |
position(long newPosition) |
int |
read(ByteBuffer dst) |
long |
size() |
AzureSeekableByteChannel |
truncate(long size) |
int |
write(ByteBuffer src) |
public int read(ByteBuffer dst) throws IOException
read
in interface ReadableByteChannel
read
in interface SeekableByteChannel
IOException
public int write(ByteBuffer src) throws IOException
write
in interface SeekableByteChannel
write
in interface WritableByteChannel
IOException
public long position() throws IOException
position
in interface SeekableByteChannel
IOException
public AzureSeekableByteChannel position(long newPosition) throws IOException
position
in interface SeekableByteChannel
IOException
public long size() throws IOException
size
in interface SeekableByteChannel
IOException
public AzureSeekableByteChannel truncate(long size) throws IOException
truncate
in interface SeekableByteChannel
IOException
public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
close
in interface Channel
IOException
Copyright © 2021 Microsoft Corporation. All rights reserved.