An implementation of ImageInputStream that gets its input from a regular InputStream. A file is used to cache previously read data.
An implementation of ImageInputStream that gets its input from a regular InputStream. A file is used to cache previously read data.
(->file-cache-image-input-stream stream cache-dir)
Constructor.
Constructs a FileCacheImageInputStream that will read from a given InputStream.
A temporary file is used as a cache. If cacheDiris non-null and is a directory, the file will be created there. If it is null, the system-dependent default temporary-file directory will be used (see the documentation for File.createTempFile for details).
stream - an InputStream to read from. - java.io.InputStream
cache-dir - a File indicating where the cache file should be created, or null to use the system directory. - java.io.File
throws: java.lang.IllegalArgumentException - if cacheDir is non-null but is not a directory.
Constructor. Constructs a FileCacheImageInputStream that will read from a given InputStream. A temporary file is used as a cache. If cacheDiris non-null and is a directory, the file will be created there. If it is null, the system-dependent default temporary-file directory will be used (see the documentation for File.createTempFile for details). stream - an InputStream to read from. - `java.io.InputStream` cache-dir - a File indicating where the cache file should be created, or null to use the system directory. - `java.io.File` throws: java.lang.IllegalArgumentException - if cacheDir is non-null but is not a directory.
(cached-file? this)
Returns true since this ImageInputStream maintains a file cache.
returns: true. - boolean
Returns true since this ImageInputStream maintains a file cache. returns: true. - `boolean`
(cached-memory? this)
Returns false since this ImageInputStream does not maintain a main memory cache.
returns: false. - boolean
Returns false since this ImageInputStream does not maintain a main memory cache. returns: false. - `boolean`
(cached? this)
Returns true since this ImageInputStream caches data in order to allow seeking backwards.
returns: true. - boolean
Returns true since this ImageInputStream caches data in order to allow seeking backwards. returns: true. - `boolean`
(close this)
Closes this FileCacheImageInputStream, closing and removing the cache file. The source InputStream is not closed.
throws: java.io.IOException - if an error occurs.
Closes this FileCacheImageInputStream, closing and removing the cache file. The source InputStream is not closed. throws: java.io.IOException - if an error occurs.
(read this)
(read this b off len)
Description copied from class: ImageInputStreamImpl
b - an array of bytes to be written to. - byte[]
off - the starting position within b to write to. - int
len - the maximum number of bytes to read. - int
returns: the number of bytes actually read, or -1
to indicate EOF. - int
throws: java.io.IOException - if an I/O error occurs.
Description copied from class: ImageInputStreamImpl b - an array of bytes to be written to. - `byte[]` off - the starting position within b to write to. - `int` len - the maximum number of bytes to read. - `int` returns: the number of bytes actually read, or -1 to indicate EOF. - `int` throws: java.io.IOException - if an I/O error occurs.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close