public class GuestChannel extends FileChannel
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL Stephan Pfab BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. **** END LICENSE BLOCK ****
FileChannel.MapMode| Constructor and Description |
|---|
GuestChannel(FileChannel host,
Runnable onClose) |
| Modifier and Type | Method and Description |
|---|---|
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() |
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, isOpenpublic GuestChannel(FileChannel host, Runnable onClose)
public int read(ByteBuffer dst) throws IOException
read in interface ReadableByteChannelread in interface SeekableByteChannelread in class FileChannelIOExceptionpublic long read(ByteBuffer[] dsts, int offset, int length) throws IOException
read in interface ScatteringByteChannelread in class FileChannelIOExceptionpublic int write(ByteBuffer src) throws IOException
write in interface SeekableByteChannelwrite in interface WritableByteChannelwrite in class FileChannelIOExceptionpublic long write(ByteBuffer[] srcs, int offset, int length) throws IOException
write in interface GatheringByteChannelwrite in class FileChannelIOExceptionpublic long position()
throws IOException
position in interface SeekableByteChannelposition in class FileChannelIOExceptionpublic FileChannel position(long newPosition) throws IOException
position in interface SeekableByteChannelposition in class FileChannelIOExceptionpublic long size()
throws IOException
size in interface SeekableByteChannelsize in class FileChannelIOExceptionpublic FileChannel truncate(long size) throws IOException
truncate in interface SeekableByteChanneltruncate in class FileChannelIOExceptionpublic void force(boolean metaData)
throws IOException
force in class FileChannelIOExceptionpublic long transferTo(long position,
long count,
WritableByteChannel target)
throws IOException
transferTo in class FileChannelIOExceptionpublic long transferFrom(ReadableByteChannel src, long position, long count) throws IOException
transferFrom in class FileChannelIOExceptionpublic int read(ByteBuffer dst, long position) throws IOException
read in class FileChannelIOExceptionpublic int write(ByteBuffer src, long position) throws IOException
write in class FileChannelIOExceptionpublic MappedByteBuffer map(FileChannel.MapMode mode, long position, long size) throws IOException
map in class FileChannelIOExceptionpublic FileLock lock(long position, long size, boolean shared) throws IOException
lock in class FileChannelIOExceptionpublic FileLock tryLock(long position, long size, boolean shared) throws IOException
tryLock in class FileChannelIOExceptionprotected void implCloseChannel()
throws IOException
implCloseChannel in class AbstractInterruptibleChannelIOExceptionCopyright © 2015. All rights reserved.