MCPcopy Create free account
hub / github.com/diyhi/bbs / copyForRead

Method copyForRead

src/main/java/cms/cache/EhcacheCopyStrategy.java:26–41  ·  view source on GitHub ↗

参考net.sf.ehcache.store.ReadWriteSerializationCopyStrategy.java

(Object storedValue)

Source from the content-addressed store, hash-verified

24 * 参考net.sf.ehcache.store.ReadWriteSerializationCopyStrategy.java
25 */
26 @Override
27 public Object copyForRead(Object storedValue) {
28 if(storedValue != null){
29 ByteArrayInputStream bin = new ByteArrayInputStream((byte[]) storedValue);
30
31 try (ObjectInputStream ois = new ObjectInputStream(bin);){
32
33 return ois.readObject();
34 } catch (Exception e) {
35 if (logger.isErrorEnabled()) {
36 logger.error("copyForRead序列化错误",e);
37 }
38 }
39 }
40 return storedValue;
41 }
42
43 @Override
44 public Object copyForWrite(Object value) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected