BlockSizeTooSmallException.java

  1. /*
  2.  * Copyright (C) 2017, Google Inc. and others
  3.  *
  4.  * This program and the accompanying materials are made available under the
  5.  * terms of the Eclipse Distribution License v. 1.0 which is available at
  6.  * https://www.eclipse.org/org/documents/edl-v10.php.
  7.  *
  8.  * SPDX-License-Identifier: BSD-3-Clause
  9.  */

  10. package org.eclipse.jgit.internal.storage.reftable;

  11. import java.io.IOException;

  12. /**
  13.  * Thrown if {@link org.eclipse.jgit.internal.storage.reftable.ReftableWriter}
  14.  * cannot fit a reference.
  15.  */
  16. public class BlockSizeTooSmallException extends IOException {
  17.     private static final long serialVersionUID = 1L;

  18.     private final int minBlockSize;

  19.     BlockSizeTooSmallException(int b) {
  20.         minBlockSize = b;
  21.     }

  22.     /**
  23.      * Get minimum block size in bytes reftable requires to write a ref.
  24.      *
  25.      * @return minimum block size in bytes reftable requires to write a ref.
  26.      */
  27.     public int getMinimumBlockSize() {
  28.         return minBlockSize;
  29.     }
  30. }