@SuppressWarnings("deprecation") @Override public void serialize(SerializerOutput out, ValueContainer value) throws IOException { out.writeInt(value.count); for (ArrayList<Datum> tuple : value.tuples) { int index = -1; for (ColumnDefinition datumType : colsDef) { if (datumType.getColDataType().getDataType().equalsIgnoreCase("long") || datumType.getColDataType().getDataType().equalsIgnoreCase("int") || datumType.getColDataType().getDataType().equalsIgnoreCase("number") || datumType.getColDataType().getDataType().equalsIgnoreCase("integer")) { out.writeLong((long) tuple.get(++index).getValue()); } else if (datumType.getColDataType().getDataType().equalsIgnoreCase("double") || datumType.getColDataType().getDataType().equalsIgnoreCase("float") || datumType.getColDataType().getDataType().equalsIgnoreCase("decimal")) { out.writeDouble((double) tuple.get(++index).getValue()); } else if (datumType.getColDataType().getDataType().equalsIgnoreCase("date")) { index++; out.writeInt(((Date) (tuple.get(index).getValue())).getYear()); out.writeInt(((Date) (tuple.get(index).getValue())).getMonth()); out.writeInt(((Date) (tuple.get(index).getValue())).getDate()); } else { out.writeUTF(tuple.get(++index).getValue().toString()); } } } }