Beispiel #1
0
 @Override
 public Cell<Snippet> encode(Snippet s) {
   // We assume only one occurrence of a snippet inside a single function
   return Cell.make(s.getHash(), s.getFunction(), s.toByteString());
 }
Beispiel #2
0
 @Override
 public Snippet decode(Cell<Snippet> encoded) throws InvalidProtocolBufferException {
   return Snippet.parseFrom(encoded.getCellContents());
 }
Beispiel #3
0
 @Override
 public Cell<Snippet> encode(Snippet s) {
   return Cell.make(s.getFunction(), s.getHash(), s.toByteString());
 }