class StringArrayAdapter extends TypeAdapter<String[]> {

  @Override
  public byte[] serialize(String[] data) {
    if (data.length == 0) {
      return new byte[Serialization.SIZE_OF_INT];
    }
    byte[] buf = new byte[Serialization.sizeOfStringArray(data)];

    int pos = 0;

    Serialization.put(buf, Serialization.toByteArray(data.length), pos);
    pos += Serialization.SIZE_OF_INT;

    for (String string : data) {
      byte[] arr = Serialization.encode(string);
      Serialization.put(buf, arr, pos);
      pos += arr.length;
    }

    return buf;
  }

  public  StringArrayAdapter();

}