Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8206447

InflaterInputStream.skip receives long but it's limited to Integer.MAX_VALUE

    XMLWordPrintable

Details

    • b26
    • x86_64
    • windows_7

    Description

      ADDITIONAL SYSTEM INFORMATION :
      Java: 1.8.0_172; Java HotSpot(TM) 64-Bit Server VM 25.73-b02
      System: Windows 7 version 6.1 running on amd64; Cp1252; es_ES (nb)

      A DESCRIPTION OF THE PROBLEM :
      Despite skip method receives and return long values the internal code uses integer therefore it's limited to Integer.MAX_VALUE. This is a behavior not specified in Javadoc and probably breaks the InputStream contract.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      try(ZipFile zipFile=new ZipFile("<zipfile>")){
      long counter=0l;
      try(InputStream stream=actual.openStream(zipFile, "<zipentry greater than Integer.MAX_VALUE>")){
      actual=stream.skip(Long.valueOf(Integer.MAX_VALUE)+1l);
      }
      }

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      actual==Long.valueOf(Integer.MAX_VALUE)+1l;
      ACTUAL -
      actual==Long.valueOf(Integer.MAX_VALUE);

      CUSTOMER SUBMITTED WORKAROUND :
      cycle skip class when skip value is greater than Integer.MAX_VALUE

      Attachments

        Issue Links

          Activity

            People

              jpai Jaikiran Pai
              webbuggrp Webbug Group
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: