001/*
002 * Licensed to the Apache Software Foundation (ASF) under one
003 * or more contributor license agreements.  See the NOTICE file
004 * distributed with this work for additional information
005 * regarding copyright ownership.  The ASF licenses this file
006 * to you under the Apache License, Version 2.0 (the
007 * "License"); you may not use this file except in compliance
008 * with the License.  You may obtain a copy of the License at
009 *
010 *   https://www.apache.org/licenses/LICENSE-2.0
011 *
012 * Unless required by applicable law or agreed to in writing,
013 * software distributed under the License is distributed on an
014 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
015 * KIND, either express or implied.  See the License for the
016 * specific language governing permissions and limitations
017 * under the License.
018 */
019package org.apache.commons.compress.utils;
020
021import java.io.InputStream;
022import java.util.zip.CRC32;
023
024/**
025 * A stream that verifies the CRC of the data read once the stream is exhausted.
026 *
027 * @NotThreadSafe
028 * @since 1.6
029 * @deprecated Use {@link org.apache.commons.io.input.ChecksumInputStream}.
030 */
031@Deprecated
032public class CRC32VerifyingInputStream extends ChecksumVerifyingInputStream {
033    /**
034     * Constructs a new instance.
035     *
036     * @param in            the stream to wrap
037     * @param size          the of the stream's content
038     * @param expectedCrc32 the expected checksum
039     * @deprecated No longer used.
040     */
041    @Deprecated
042    public CRC32VerifyingInputStream(final InputStream in, final long size, final int expectedCrc32) {
043        this(in, size, expectedCrc32 & 0xFFFFffffL);
044    }
045
046    /**
047     * Constructs a new instance.
048     *
049     * @param in            the stream to wrap
050     * @param size          the of the stream's content
051     * @param expectedCrc32 the expected checksum
052     * @since 1.7
053     */
054    public CRC32VerifyingInputStream(final InputStream in, final long size, final long expectedCrc32) {
055        super(new CRC32(), in, size, expectedCrc32);
056    }
057
058}