@Override public void write(Kryo kryo,Output output){
  int size=index.size();
  output.writeInt(size + 1,true);
  for (int i=0; i < size; ++i) {
    String s=index.get(i);
    if (s == null) {
      throw new RuntimeException("Cannot serialize null string at index " + Integer.toString(i));
    }
    output.writeString(s);
  }
}

@ Override public void write ( Kryo kryo , Output output ) { int size = index . size ( ) ; output . writeInt ( size + 1 , true ) ; for ( int i = 0 ; i < size ; ++ i ) { String s = index . get ( i ) ; if ( s == null ) { throw new RuntimeException ( "Cannot serialize null string at index " + Integer . toString ( i ) ) ; } output . writeString ( s ) ; } }
custom serializer . follows kryo ' s stringarrayserializer example .
