public class SftpFileChannel extends FileChannel
FileChannel.MapMode
Modifier and Type | Field and Description |
---|---|
static String |
COPY_BUFSIZE_PROP |
static int |
DEFAULT_TRANSFER_BUFFER_SIZE |
static Set<SftpClient.OpenMode> |
READ_MODES |
static Set<SftpClient.OpenMode> |
WRITE_MODES |
Constructor and Description |
---|
SftpFileChannel(SftpPath p,
Collection<SftpClient.OpenMode> modes) |
Modifier and Type | Method and Description |
---|---|
protected long |
doRead(List<ByteBuffer> buffers,
long position) |
protected long |
doWrite(List<ByteBuffer> buffers,
long position) |
void |
force(boolean metaData) |
protected void |
implCloseChannel() |
FileLock |
lock(long position,
long size,
boolean shared) |
MappedByteBuffer |
map(FileChannel.MapMode mode,
long position,
long size) |
long |
position() |
FileChannel |
position(long newPosition) |
int |
read(ByteBuffer dst) |
long |
read(ByteBuffer[] dsts,
int offset,
int length) |
int |
read(ByteBuffer dst,
long position) |
long |
size() |
String |
toString() |
long |
transferFrom(ReadableByteChannel src,
long position,
long count) |
long |
transferTo(long position,
long count,
WritableByteChannel target) |
FileChannel |
truncate(long size) |
FileLock |
tryLock(long position,
long size,
boolean shared) |
int |
write(ByteBuffer src) |
long |
write(ByteBuffer[] srcs,
int offset,
int length) |
int |
write(ByteBuffer src,
long position) |
begin, close, end, isOpen
public static final String COPY_BUFSIZE_PROP
public static final int DEFAULT_TRANSFER_BUFFER_SIZE
public static final Set<SftpClient.OpenMode> READ_MODES
public static final Set<SftpClient.OpenMode> WRITE_MODES
public SftpFileChannel(SftpPath p, Collection<SftpClient.OpenMode> modes) throws IOException
IOException
public int read(ByteBuffer dst) throws IOException
read
in interface ReadableByteChannel
read
in interface SeekableByteChannel
read
in class FileChannel
IOException
public int read(ByteBuffer dst, long position) throws IOException
read
in class FileChannel
IOException
public long read(ByteBuffer[] dsts, int offset, int length) throws IOException
read
in interface ScatteringByteChannel
read
in class FileChannel
IOException
protected long doRead(List<ByteBuffer> buffers, long position) throws IOException
IOException
public int write(ByteBuffer src) throws IOException
write
in interface SeekableByteChannel
write
in interface WritableByteChannel
write
in class FileChannel
IOException
public int write(ByteBuffer src, long position) throws IOException
write
in class FileChannel
IOException
public long write(ByteBuffer[] srcs, int offset, int length) throws IOException
write
in interface GatheringByteChannel
write
in class FileChannel
IOException
protected long doWrite(List<ByteBuffer> buffers, long position) throws IOException
IOException
public long position() throws IOException
position
in interface SeekableByteChannel
position
in class FileChannel
IOException
public FileChannel position(long newPosition) throws IOException
position
in interface SeekableByteChannel
position
in class FileChannel
IOException
public long size() throws IOException
size
in interface SeekableByteChannel
size
in class FileChannel
IOException
public FileChannel truncate(long size) throws IOException
truncate
in interface SeekableByteChannel
truncate
in class FileChannel
IOException
public void force(boolean metaData) throws IOException
force
in class FileChannel
IOException
public long transferTo(long position, long count, WritableByteChannel target) throws IOException
transferTo
in class FileChannel
IOException
public long transferFrom(ReadableByteChannel src, long position, long count) throws IOException
transferFrom
in class FileChannel
IOException
public MappedByteBuffer map(FileChannel.MapMode mode, long position, long size) throws IOException
map
in class FileChannel
IOException
public FileLock lock(long position, long size, boolean shared) throws IOException
lock
in class FileChannel
IOException
public FileLock tryLock(long position, long size, boolean shared) throws IOException
tryLock
in class FileChannel
IOException
protected void implCloseChannel() throws IOException
implCloseChannel
in class AbstractInterruptibleChannel
IOException
Copyright © 2008–2016 The Apache Software Foundation. All rights reserved.