|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public static interface Cache.Entry
Represents a single entry in the Cache. Each Entry can be read from or
written to until the close()
method is called, at which point no
further writes can be made
Method Summary | |
---|---|
Cache.Entry |
cloneEntry()
Create and return a clone of this entry. |
void |
close()
Close the Entry. |
BackedInputStream |
getInputStream()
Return an InputStream to read from this Entry. |
OutputStream |
getOutputStream()
Return an OutputStream to write to this Entry. |
int |
size()
Return the size of this Entries buffer in bytes |
void |
writeTo(OutputStream out)
Write the entire contents of this Entry to the specified OutputStream . |
Method Detail |
---|
OutputStream getOutputStream()
OutputStream
don't have to be synchronised as it's assumed that only one thread
will write to one item at a time. This method will be called repeatedly
for the same Entry, and it's essential that the same object is returned
each time. No further calls will be made to this method after close()
has been called.
BackedInputStream getInputStream()
InputStream
should be returned every time this method is called, as it may be called
more than once in different threads (when reusing an image across threads,
for example). Unless the stream is returned directly to the user (as in
the PDFSound.getStream()
method), this stream will be closed by
the library.
void writeTo(OutputStream out) throws IOException
OutputStream
.
IOException
int size()
Cache.Entry cloneEntry()
close()
method, although as no further writes are possible after that stage there is no
need to clone the underlying buffer.
void close()
OutputStream
, and the buffer can be written to secondary memory
if space is tight.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |