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

org.apache.lucene.codecs.compressing.Decompressor Maven / Gradle / Ivy

There is a newer version: 9.1.7.Final
Show newest version
package org.apache.lucene.codecs.compressing;

/*
 * Licensed to the Apache Software Foundation (ASF) under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The ASF licenses this file to You under the Apache License, Version 2.0
 * (the "License"); you may not use this file except in compliance with
 * the License.  You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

import java.io.IOException;

import org.apache.lucene.store.DataInput;
import org.apache.lucene.util.BytesRef;

/**
 * A decompressor.
 */
public abstract class Decompressor implements Cloneable {

  /** Sole constructor, typically called from sub-classes. */
  protected Decompressor() {}

  /**
   * Decompress bytes that were stored between offsets offset and
   * offset+length in the original stream from the compressed
   * stream in to bytes. After returning, the length
   * of bytes (bytes.length) must be equal to
   * length. Implementations of this method are free to resize
   * bytes depending on their needs.
   *
   * @param in the input that stores the compressed stream
   * @param originalLength the length of the original data (before compression)
   * @param offset bytes before this offset do not need to be decompressed
   * @param length bytes after offset+length do not need to be decompressed
   * @param bytes a {@link BytesRef} where to store the decompressed data
   */
  public abstract void decompress(DataInput in, int originalLength, int offset, int length, BytesRef bytes) throws IOException;

  @Override
  public abstract Decompressor clone();

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy