1 package org.apache.lucene.util.encoding;
3 import java.io.IOException;
4 import java.io.OutputStream;
7 * Licensed to the Apache Software Foundation (ASF) under one or more
8 * contributor license agreements. See the NOTICE file distributed with
9 * this work for additional information regarding copyright ownership.
10 * The ASF licenses this file to You under the Apache License, Version 2.0
11 * (the "License"); you may not use this file except in compliance with
12 * the License. You may obtain a copy of the License at
14 * http://www.apache.org/licenses/LICENSE-2.0
16 * Unless required by applicable law or agreed to in writing, software
17 * distributed under the License is distributed on an "AS IS" BASIS,
18 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19 * See the License for the specific language governing permissions and
20 * limitations under the License.
24 * An abstract implementation of {@link IntEncoder} which is served as a filter
25 * on the values to encode. An encoder filter wraps another {@link IntEncoder}
26 * which does the actual encoding. This allows for chaining filters and
27 * encoders, such as: <code><pre>
28 * new UniqueValuesIntEncoder(new DGapIntEncoder(new VInt8IntEnoder()));
29 * {@link UniqueValuesIntEncoder} followed by {@link DGapIntEncoder}
32 * The default implementation implements {@link #close()} by closing the wrapped
33 * encoder and {@link #reInit(OutputStream)} by re-initializing the wrapped
36 * @lucene.experimental
38 public abstract class IntEncoderFilter extends IntEncoder {
40 protected final IntEncoder encoder;
42 protected IntEncoderFilter(IntEncoder encoder) {
43 this.encoder = encoder;
47 public void close() throws IOException {
48 // There is no need to call super.close(), since we don't pass the output
54 public void reInit(OutputStream out) {