Class FileCache
java.lang.Object
com.twelvemonkeys.imageio.stream.FileCache
- All Implemented Interfaces:
Cache, Closeable, AutoCloseable, ByteChannel, Channel, ReadableByteChannel, SeekableByteChannel, WritableByteChannel
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) static final intprivate final FileChannelprivate final ReadableByteChannel -
Constructor Summary
ConstructorsConstructorDescriptionFileCache(InputStream stream, File cacheDir) FileCache(ReadableByteChannel channel, File cacheDir) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()(package private) voidfetch()voidflushBefore(long pos) booleanisOpen()longposition()position(long newPosition) intread(ByteBuffer dest) longsize()truncate(long size) intwrite(ByteBuffer src)
-
Field Details
-
BLOCK_SIZE
static final int BLOCK_SIZE- See Also:
-
cache
-
channel
-
-
Constructor Details
-
FileCache
FileCache(InputStream stream, File cacheDir) throws IOException - Throws:
IOException
-
FileCache
- Throws:
IOException
-
-
Method Details
-
fetch
- Throws:
IOException
-
isOpen
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceChannel- Specified by:
closein interfaceCloseable- Throws:
IOException
-
read
- Specified by:
readin interfaceReadableByteChannel- Specified by:
readin interfaceSeekableByteChannel- Throws:
IOException
-
position
- Specified by:
positionin interfaceSeekableByteChannel- Throws:
IOException
-
position
- Specified by:
positionin interfaceSeekableByteChannel- Throws:
IOException
-
size
public long size()- Specified by:
sizein interfaceSeekableByteChannel
-
write
- Specified by:
writein interfaceSeekableByteChannel- Specified by:
writein interfaceWritableByteChannel
-
truncate
- Specified by:
truncatein interfaceSeekableByteChannel
-
flushBefore
public void flushBefore(long pos) - Specified by:
flushBeforein interfaceCache
-