@Override
    public int calculateCapacity(int requiredLength) {
      return Math.max(64, Math.min(Integer.highestOneBit(requiredLength * 3 / 2) << 1, (requiredLength / 1024 + 1) * 1024));
    }
@Override
    public int calculateCapacity(int requiredLength)