All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.sf.mmm.util.io.api.BufferExceedException Maven / Gradle / Ivy

/* Copyright (c) The m-m-m Team, Licensed under the Apache License, Version 2.0
 * http://www.apache.org/licenses/LICENSE-2.0 */
package net.sf.mmm.util.io.api;

import net.sf.mmm.util.exception.api.NlsRuntimeException;
import net.sf.mmm.util.io.NlsBundleUtilIoRoot;

/**
 * A {@link BufferExceedException} is thrown if a buffer (typically array of bytes or chars) is exceeded (e.g. offset or
 * length are out of range).
 *
 * @author Joerg Hohwiller (hohwille at users.sourceforge.net)
 * @since 1.1.0
 */
public class BufferExceedException extends NlsRuntimeException {

  private static final long serialVersionUID = -5375096243963460300L;

  /** @see #getCode() */
  public static final String MESSAGE_CODE = "BufExceed";

  /**
   * The constructor.
   *
   * @param length is the given size that exceeds the buffer.
   * @param capacity is the available capacity of the buffer.
   */
  public BufferExceedException(int length, int capacity) {

    super(createBundle(NlsBundleUtilIoRoot.class).errorBufferLengthExceed(length, capacity));
  }

  @Override
  public String getCode() {

    return MESSAGE_CODE;
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy