8265496: improve null check in DeflaterOutputStream/InflaterInputStream

Reviewed-by: lancea, naoto
This commit is contained in:
Hamlin Li 2021-04-27 01:06:56 +00:00
parent 1d37b9840a
commit 15d4787724
8 changed files with 15 additions and 15 deletions

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 1996, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1996, 2021, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -90,7 +90,7 @@ public class GZIPOutputStream extends DeflaterOutputStream {
public GZIPOutputStream(OutputStream out, int size, boolean syncFlush)
throws IOException
{
super(out, new Deflater(Deflater.DEFAULT_COMPRESSION, true),
super(out, out != null ? new Deflater(Deflater.DEFAULT_COMPRESSION, true) : null,
size,
syncFlush);
usesDefaultDeflater = true;