class BooleanArrayAdapter extends TypeAdapter<boolean[]> {

  @Override
  public byte[] serialize(boolean[] array) {
    final byte[] buf = new byte[getSerializedSize(array)];
    if (array.length == 0) {
      return buf;
    }
    int pos = 0;
    Serialization.put(buf, Serialization.toByteArray(array.length), pos);
    pos += Serialization.SIZE_OF_INT;

    for (boolean val : array) {
      byte[] arr = Serialization.toByteArray(val);
      Serialization.put(buf, arr, pos);
      pos += Serialization.SIZE_OF_BOOL;
    }
    return buf;
  }

  public  BooleanArrayAdapter();

}