WriteNullsProtocol nullProtocol =
(oprot instanceof WriteNullsProtocol) ? (WriteNullsProtocol) oprot : null;
if (o instanceof List) {
List<?> list = (List<?>) o;
oprot.writeListBegin(new TList(mt.getType(), list.size()));
for (Object element : list) {
if (element == null) {
assert (nullProtocol != null);
nullProtocol.writeNull();
} else {
mt.serialize(element, elementObjectInspector, oprot);
}
}
} else {
Object[] list = (Object[]) o;
oprot.writeListBegin(new TList(mt.getType(), list.length));
for (Object element : list) {
if (element == null && nullProtocol != null) {
assert (nullProtocol != null);
nullProtocol.writeNull();
} else {