|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
com.beem.project.beem.smack.avatar
Class MemoryAvatarCache
java.lang.Objectcom.beem.project.beem.smack.avatar.MemoryAvatarCache
- All Implemented Interfaces:
- AvatarCache
public class MemoryAvatarCache
- extends Object
- implements AvatarCache
- extends Object
An avatar cache which store the avatars in memory.
| Constructor Summary | |
|---|---|
MemoryAvatarCache(int maxSize,
long maxlifetime)
Create a MemoryAvatarCache. |
|
| Method Summary | |
|---|---|
boolean |
contains(String key)
Test if a data is in cache. |
byte[] |
get(String key)
Get some data from the cache. |
void |
put(String key,
byte[] data)
Put some datas in cache. |
void |
put(String key,
InputStream in)
Put some datas in cache. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
MemoryAvatarCache
public MemoryAvatarCache(int maxSize,
long maxlifetime)
- Create a MemoryAvatarCache.
- Parameters:
maxSize- the maximum number of objects the cache will hold. -1 means the cache has no max size.maxlifetime- the maximum amount of time (in ms) objects can exist in cache before being deleted. -1 means objects never expire.
| Method Detail |
|---|
put
public void put(String key, byte[] data) throws IOException
- Description copied from interface:
AvatarCache - Put some datas in cache.
- Specified by:
putin interfaceAvatarCache
- Parameters:
key- the key id of the datadata- the data to cache- Throws:
IOException- if an IO error occurs while caching the data
put
public void put(String key, InputStream in) throws IOException
- Description copied from interface:
AvatarCache - Put some datas in cache.
- Specified by:
putin interfaceAvatarCache
- Parameters:
key- the key id of the datain- an InputStream to the data to cache- Throws:
IOException- if an IO error occurs while caching the data
get
public byte[] get(String key) throws IOException
- Description copied from interface:
AvatarCache - Get some data from the cache.
- Specified by:
getin interfaceAvatarCache
- Parameters:
key- the id of the data to get- Returns:
- the cached data
- Throws:
IOException- if an IO error occurs while geting the data
contains
public boolean contains(String key)
- Description copied from interface:
AvatarCache - Test if a data is in cache.
- Specified by:
containsin interfaceAvatarCache
- Parameters:
key- the id of the data- Returns:
- true if data is in cache false otherwise
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
Copyright © 2009 Beem-project.com. All Rights Reserved.

com.beem.project.beem.smack.avatar.MemoryAvatarCache