Mercurial > hg > Papers > 2015 > nozomi-sigos
comparison paper/source/asClass.java @ 0:0127effb8fcd
first commit
author | Nozomi Teruya <e125769@ie.u-ryukyu.ac.jp> |
---|---|
date | Tue, 05 May 2015 15:36:41 +0900 |
parents | |
children | 4a7fa91ef60a |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:0127effb8fcd |
---|---|
1 public <T> T asClass(Class<T> clazz) { | |
2 if (!byteArray) { | |
3 return (T) val; | |
4 } | |
5 byte[] b = (byte[]) val; | |
6 | |
7 if (serialized) { | |
8 return SingletonMessage.getInstance().read(b, clazz); | |
9 } else { | |
10 return (T) b; | |
11 } | |
12 | |
13 } |