Class FileChannelDecorator
Object
AbstractInterruptibleChannel
FileChannel
FileChannelDecorator
- All Implemented Interfaces:
Closeable,AutoCloseable,ByteChannel,Channel,GatheringByteChannel,InterruptibleChannel,ReadableByteChannel,ScatteringByteChannel,SeekableByteChannel,WritableByteChannel
A FileChannel that delegates all calls to the underlying FileChannel but for
implCloseChannel() it also
calls ShapefileFiles.unlock method to release the lock on the URL.- Author:
- jesse
-
Nested Class Summary
Nested classes/interfaces inherited from class FileChannel
FileChannel.MapMode -
Constructor Summary
ConstructorsConstructorDescriptionFileChannelDecorator(FileChannel channel, ShpFiles shapefileFiles, URL url, FileReader requestor) FileChannelDecorator(FileChannel channel, ShpFiles shapefileFiles, URL url, FileWriter requestor) -
Method Summary
Modifier and TypeMethodDescriptionvoidforce(boolean metaData) protected voidlock(long position, long size, boolean shared) map(FileChannel.MapMode mode, long position, long size) longposition()position(long newPosition) intread(ByteBuffer dst) longread(ByteBuffer[] dsts, int offset, int length) intread(ByteBuffer dst, long position) longsize()longtransferFrom(ReadableByteChannel src, long position, long count) longtransferTo(long position, long count, WritableByteChannel target) truncate(long size) tryLock(long position, long size, boolean shared) intwrite(ByteBuffer src) longwrite(ByteBuffer[] srcs, int offset, int length) intwrite(ByteBuffer src, long position) Methods inherited from class AbstractInterruptibleChannel
begin, close, end, isOpen
-
Constructor Details
-
FileChannelDecorator
public FileChannelDecorator(FileChannel channel, ShpFiles shapefileFiles, URL url, FileReader requestor) -
FileChannelDecorator
public FileChannelDecorator(FileChannel channel, ShpFiles shapefileFiles, URL url, FileWriter requestor)
-
-
Method Details
-
force
- Specified by:
forcein classFileChannel- Throws:
IOException
-
lock
- Specified by:
lockin classFileChannel- Throws:
IOException
-
map
- Specified by:
mapin classFileChannel- Throws:
IOException
-
position
- Specified by:
positionin interfaceSeekableByteChannel- Specified by:
positionin classFileChannel- Throws:
IOException
-
position
- Specified by:
positionin interfaceSeekableByteChannel- Specified by:
positionin classFileChannel- Throws:
IOException
-
read
- Specified by:
readin classFileChannel- Throws:
IOException
-
read
- Specified by:
readin interfaceReadableByteChannel- Specified by:
readin interfaceSeekableByteChannel- Specified by:
readin classFileChannel- Throws:
IOException
-
read
- Specified by:
readin interfaceScatteringByteChannel- Specified by:
readin classFileChannel- Throws:
IOException
-
size
- Specified by:
sizein interfaceSeekableByteChannel- Specified by:
sizein classFileChannel- Throws:
IOException
-
transferFrom
- Specified by:
transferFromin classFileChannel- Throws:
IOException
-
transferTo
- Specified by:
transferToin classFileChannel- Throws:
IOException
-
truncate
- Specified by:
truncatein interfaceSeekableByteChannel- Specified by:
truncatein classFileChannel- Throws:
IOException
-
tryLock
- Specified by:
tryLockin classFileChannel- Throws:
IOException
-
write
- Specified by:
writein classFileChannel- Throws:
IOException
-
write
- Specified by:
writein interfaceSeekableByteChannel- Specified by:
writein interfaceWritableByteChannel- Specified by:
writein classFileChannel- Throws:
IOException
-
write
- Specified by:
writein interfaceGatheringByteChannel- Specified by:
writein classFileChannel- Throws:
IOException
-
implCloseChannel
- Specified by:
implCloseChannelin classAbstractInterruptibleChannel- Throws:
IOException
-