src/java.base/share/classes/java/util/zip/CRC32C.java

Print this page
rev 12972 : 8140606: Update library code to use internal Unsafe
Reviewed-by: duke


  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 package java.util.zip;
  26 
  27 import java.nio.ByteBuffer;
  28 import java.nio.ByteOrder;
  29 
  30 import jdk.internal.HotSpotIntrinsicCandidate;
  31 import sun.misc.Unsafe;
  32 import sun.nio.ch.DirectBuffer;
  33 
  34 /**
  35  * A class that can be used to compute the CRC-32C of a data stream.
  36  *
  37  * <p>
  38  * CRC-32C is defined in <a href="http://www.ietf.org/rfc/rfc3720.txt">RFC
  39  * 3720</a>: Internet Small Computer Systems Interface (iSCSI).
  40  * </p>
  41  *
  42  * <p>
  43  * Passing a {@code null} argument to a method in this class will cause a
  44  * {@link NullPointerException} to be thrown.
  45  * </p>
  46  *
  47  * @since 1.9
  48  */
  49 public final class CRC32C implements Checksum {
  50 
  51     /*




  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 package java.util.zip;
  26 
  27 import java.nio.ByteBuffer;
  28 import java.nio.ByteOrder;
  29 
  30 import jdk.internal.HotSpotIntrinsicCandidate;
  31 import jdk.internal.misc.Unsafe;
  32 import sun.nio.ch.DirectBuffer;
  33 
  34 /**
  35  * A class that can be used to compute the CRC-32C of a data stream.
  36  *
  37  * <p>
  38  * CRC-32C is defined in <a href="http://www.ietf.org/rfc/rfc3720.txt">RFC
  39  * 3720</a>: Internet Small Computer Systems Interface (iSCSI).
  40  * </p>
  41  *
  42  * <p>
  43  * Passing a {@code null} argument to a method in this class will cause a
  44  * {@link NullPointerException} to be thrown.
  45  * </p>
  46  *
  47  * @since 1.9
  48  */
  49 public final class CRC32C implements Checksum {
  50 
  51     /*