| Conditions | 2 |
| Total Lines | 10 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 8 |
| CRAP Score | 2 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | package io.mcarle.sciurus.cache.redis; |
||
| 26 | static RedisData fromByteBuffer(final ByteBuffer byteBuffer) { |
||
| 27 | try { |
||
| 28 | 1 | byte[] data = new byte[byteBuffer.remaining()]; |
|
| 29 | 1 | byteBuffer.get(data); |
|
| 30 | 1 | ObjectInputStream ois = new ObjectInputStream(new ByteArrayInputStream(data)); |
|
| 31 | 1 | Object o = ois.readObject(); |
|
| 32 | 1 | ois.close(); |
|
| 33 | 1 | return (RedisData) o; |
|
| 34 | 1 | } catch (Exception e) { |
|
| 35 | 1 | throw new RuntimeException(e); |
|
| 36 | } |
||
| 43 |