MCPcopy Create free account
hub / github.com/apache/pig / serializeToBytes

Method serializeToBytes

src/org/apache/pig/builtin/PigStreaming.java:61–78  ·  view source on GitHub ↗
(Tuple t)

Source from the content-addressed store, hash-verified

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 {

Callers

nothing calls this directly

Calls 5

putFieldMethod · 0.95
sizeMethod · 0.65
getMethod · 0.65
resetMethod · 0.45
writeMethod · 0.45

Tested by

no test coverage detected