(Tuple t)
| 59 | } |
| 60 | |
| 61 | @Override |
| 62 | public WritableByteArray serializeToBytes(Tuple t) throws IOException { |
| 63 | out.reset(); |
| 64 | int sz = t.size(); |
| 65 | for (int i=0; i<sz; i++) { |
| 66 | Object field = t.get(i); |
| 67 | |
| 68 | StorageUtil.putField(out,field); |
| 69 | |
| 70 | if (i == sz - 1) { |
| 71 | // last field in tuple. |
| 72 | out.write(recordDel); |
| 73 | } else { |
| 74 | out.write(fieldDel); |
| 75 | } |
| 76 | } |
| 77 | return out; |
| 78 | } |
| 79 | |
| 80 | @Override |
| 81 | public Tuple deserialize(byte[] bytes, int offset, int length) throws IOException { |