An implementation of ImageOutputStream that writes its output to a regular OutputStream. A file is used to cache data until it is flushed to the output stream.
An implementation of ImageOutputStream that writes its output to a regular OutputStream. A file is used to cache data until it is flushed to the output stream.
(->file-cache-image-output-stream stream cache-dir)
Constructor.
Constructs a FileCacheImageOutputStream that will write to a given outputStream.
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 OutputStream to write to. - java.io.OutputStream
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 FileCacheImageOutputStream that will write to a given outputStream. 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 OutputStream to write to. - `java.io.OutputStream` 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 ImageOutputStream maintains a file cache.
returns: true. - boolean
Returns true since this ImageOutputStream maintains a file cache. returns: true. - `boolean`
(cached-memory? this)
Returns false since this ImageOutputStream does not maintain a main memory cache.
returns: false. - boolean
Returns false since this ImageOutputStream does not maintain a main memory cache. returns: false. - `boolean`
(cached? this)
Returns true since this ImageOutputStream caches data in order to allow seeking backwards.
returns: true. - boolean
Returns true since this ImageOutputStream caches data in order to allow seeking backwards. returns: true. - `boolean`
(close this)
Closes this FileCacheImageOutputStream. All pending data is flushed to the output, and the cache file is closed and removed. The destination OutputStream is not closed.
throws: java.io.IOException - if an error occurs.
Closes this FileCacheImageOutputStream. All pending data is flushed to the output, and the cache file is closed and removed. The destination OutputStream is not closed. throws: java.io.IOException - if an error occurs.
(flush-before this pos)
Description copied from interface: ImageInputStream
pos - a long containing the length of the stream prefix that may be flushed. - long
throws: java.io.IOException - if an I/O error occurs.
Description copied from interface: ImageInputStream pos - a long containing the length of the stream prefix that may be flushed. - `long` throws: java.io.IOException - if an I/O error occurs.
(length this)
Description copied from class: ImageInputStreamImpl
returns: -1L to indicate unknown length. - long
Description copied from class: ImageInputStreamImpl returns: -1L to indicate unknown length. - `long`
(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.
(seek this pos)
Sets the current stream position and resets the bit offset to 0. It is legal to seek past the end of the file; an EOFException will be thrown only if a read is performed. The file length will not be increased until a write is performed.
pos - a long containing the desired file pointer position. - long
throws: java.lang.IndexOutOfBoundsException - if pos is smaller than the flushed position.
Sets the current stream position and resets the bit offset to 0. It is legal to seek past the end of the file; an EOFException will be thrown only if a read is performed. The file length will not be increased until a write is performed. pos - a long containing the desired file pointer position. - `long` throws: java.lang.IndexOutOfBoundsException - if pos is smaller than the flushed position.
(write this b)
(write this b off len)
Description copied from interface: ImageOutputStream
b - an array of bytes to be written. - byte[]
off - the start offset in the data. - int
len - the number of bytes to write. - int
throws: java.io.IOException - if an I/O error occurs.
Description copied from interface: ImageOutputStream b - an array of bytes to be written. - `byte[]` off - the start offset in the data. - `int` len - the number of bytes to write. - `int` throws: java.io.IOException - if an I/O error occurs.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close