@Override
    public void write(final Kryo kryo, final Output output, final List<?> obj) {
      try {
        final Object[] array = (Object[]) _arrayField.get(obj);
        output.writeInt(array.length, true);
        final Class<?> componentType = array.getClass().getComponentType();
        kryo.writeClass(output, componentType);
        for (final Object item : array) {
          kryo.writeClassAndObject(output, item);
        }
      } catch (final RuntimeException e) {
        // Don't eat and wrap RuntimeExceptions because the ObjectBuffer.write...
        // handles SerializationException specifically (resizing the buffer)...
        throw e;
      } catch (final Exception e) {
        throw new RuntimeException(e);
      }
    }
A kryo {@link Serializer} for lists created via {@link Arrays#asList(Object...)}.
<p>
Note: This serializer does not support cyclic references, so if one of the objects
gets set the list as attribute this might cause an error during deserialization.
</p>
<p/>
This is from kryo-serializers package. Added explicitly to avoid classpath issues.
ql/src/java/org/apache/hadoop/hive/ql/exec/SerializationUtilities.java