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

Method serialize

src/org/apache/pig/PigStreamingBase.java:46–57  ·  view source on GitHub ↗
(Tuple t)

Source from the content-addressed store, hash-verified

44public abstract class PigStreamingBase implements PigToStream, StreamToPig {
45
46 @Override
47 @Deprecated
48 public final byte[] serialize(Tuple t) throws IOException {
49 WritableByteArray data = serializeToBytes(t);
50 if (data.getLength() == data.getData().length) {
51 return data.getData();
52 } else {
53 byte[] buf = new byte[data.getLength()];
54 System.arraycopy(data.getData(), 0, buf, 0, data.getLength());
55 return buf;
56 }
57 }
58
59 /**
60 * Given a tuple, produce an array of bytes to be passed to the streaming

Callers

nothing calls this directly

Calls 3

serializeToBytesMethod · 0.95
getLengthMethod · 0.95
getDataMethod · 0.95

Tested by

no test coverage detected