Class LhaInputStream

  • All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable

    public class LhaInputStream
    extends java.io.InputStream
    ???}???????X?g???[??????LHA?????f?[?^???????}???A ?G???g???????????????????????????????[?e?B???e?B?N???X?B
    java.util.zip.ZipInputStream ???????C???^?[?t?F?C?X???????????????????B
    ?????????????????????????????????G???g?????~?? ???????????G???g???????????????}????????\?????????B
     -- revision history --
     $Log: LhaInputStream.java,v $
     Revision 1.1.2.1  2003/07/20 13:22:31  dangan
     [bug fix]
         getNextEntry() ?? CompressMethod.connectDecoder ?? 
         this.limit ???n???~?????}???? this.in ???n????????B
    
     Revision 1.1  2002/12/08 00:00:00  dangan
     [maintenance]
         LhaConstants ???? CompressMethod ?????N???X???????X???????????C???B
    
     Revision 1.0  2002/08/05 00:00:00  dangan
     add to version control
     [change]
         ?R???X?g???N?^???? ?????? String encode ?????????????p?~?A
         Properties ???????????????????????B
         ?????I?[???B????????????????????????????????????C???B
         available() ???U??????? java.util.zip.ZipInputStream ???????????
         ?G???g?????I?[???B?????????????? 1 ?G???g?????I?[???B?????????? 0 ???????????????X?B
     [maintenance]
         ?\?[?X????
         ?^?u?p?~
         ???C?Z???X????C??
    
     
    Version:
    $Revision: 1.1.2.1 $
    Author:
    $Author: dangan $
    • Constructor Summary

      Constructors 
      Constructor Description
      LhaInputStream​(java.io.InputStream in)
      in ???? LHA???????f?[?^?????????? InputStream ???\?z?????B
      ?e???k?`?????????????????????????????????v???p?e?B???? LhaProperty.getProperties() ???????????v???p?e?B???g?p???????B
      LhaInputStream​(java.io.InputStream in, java.util.Properties property)
      in ???? LHA???????f?[?^?????????? InputStream???\?z?????B
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int available()
      ?????????????????G???g?????I?[???B?????????????B
      ?u???b?N??????????????????f?[?^????????????????????????}???B
      void close()
      ?}???????X?g???[????????A?g?p??????? ?S???????\?[?X???J???????B
      void closeEntry()
      ?????????????????G???g????????A ?????G???g?????????}???????????X?g???[?????????????B
      LhaHeader getNextEntry()
      ?????G???g?????????????????????}?????????X?g???[?????????????B
      LhaHeader getNextEntryWithoutExtract()
      ?????G???g????????????????????}?????????X?g???[?????????????B
      void mark​(int readLimit)
      ?????????????????G???g???????????u???}?[?N?????????A reset() ???}?[?N???????????????u???????????????????B
      boolean markSupported()
      ???}???????????X?g???[???? mark()?? reset()???T?|?[?g?????????????B
      ?w?b?_???????????? mark/reset ???K?{?????? ?R???X?g???N?^???n?????? in ?? markSupported() ?? false ???????????A?}???N???X?? in ?? mark/reset ???T?|?[?g???? BufferedInputStream ?????b?v?????B ?????????A?}?????\?b?h?????? true ???????B
      int read()
      ???????G???g?????? 1?o?C?g???f?[?^???????????B
      int read​(byte[] buffer)
      ???????G???g?????? buffer ???????????????f?[?^???????????B
      int read​(byte[] buffer, int index, int length)
      ???????G???g?????? buffer ??index?? length?o?C?g?? ?f?[?^?????????????B
      void reset()
      ?????????????????G???g???????????????u???????? mark() ???\?b?h???????o???????????????u???????????B
      long skip​(long length)
      ???????G???g?????f?[?^?? length ?o?C?g???????????B
      • Methods inherited from class java.io.InputStream

        nullInputStream, readAllBytes, readNBytes, readNBytes, transferTo
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • LhaInputStream

        public LhaInputStream​(java.io.InputStream in)
        in ???? LHA???????f?[?^?????????? InputStream ???\?z?????B
        ?e???k?`?????????????????????????????????v???p?e?B???? LhaProperty.getProperties() ???????????v???p?e?B???g?p???????B
        Parameters:
        in - LHA?????`?????f?[?^???????????????X?g???[??
        See Also:
        LhaProperty.getProperties()
      • LhaInputStream

        public LhaInputStream​(java.io.InputStream in,
                              java.util.Properties property)
                       throws java.io.UnsupportedEncodingException
        in ???? LHA???????f?[?^?????????? InputStream???\?z?????B
        Parameters:
        in - LHA?????`?????f?[?^???????????????X?g???[??
        property - ?e???k?`?????????????????????????????????????v???p?e?B
        Throws:
        java.io.UnsupportedEncodingException - property.getProperty( "lha.encoding" ) ?????????? ?G???R?[?f?B???O?????T?|?[?g???????????
    • Method Detail

      • read

        public int read()
                 throws java.io.IOException
        ???????G???g?????? 1?o?C?g???f?[?^???????????B
        Specified by:
        read in class java.io.InputStream
        Returns:
        ?????}?????? 1?o?C?g???f?[?^?B
        ?????G???g?????I?[???B?????????? -1
        Throws:
        java.io.IOException - ?????????????????G???g????????? ???o???G???[?????????????
      • read

        public int read​(byte[] buffer)
                 throws java.io.IOException
        ???????G???g?????? buffer ???????????????f?[?^???????????B
        Overrides:
        read in class java.io.InputStream
        Parameters:
        buffer - ?f?[?^???????????o?b?t?@
        Returns:
        ?????}???????f?[?^?????B
        ?????G???g?????I?[???B?????????? -1?B
        Throws:
        java.io.IOException - ?????????????????G???g????????? ???o???G???[?????????????
      • read

        public int read​(byte[] buffer,
                        int index,
                        int length)
                 throws java.io.IOException
        ???????G???g?????? buffer ??index?? length?o?C?g?? ?f?[?^?????????????B
        Overrides:
        read in class java.io.InputStream
        Parameters:
        buffer - ?f?[?^???????????o?b?t?@
        index - buffer?????f?[?^?????????J?n???u
        length - ?????????f?[?^??
        Returns:
        ?????}???????f?[?^?????B
        ?????G???g?????I?[???B?????????? -1?B
        Throws:
        java.io.IOException - ?????????????????G???g????????? ???o???G???[?????????????
      • skip

        public long skip​(long length)
                  throws java.io.IOException
        ???????G???g?????f?[?^?? length ?o?C?g???????????B
        Overrides:
        skip in class java.io.InputStream
        Parameters:
        length - ???????????f?[?^??
        Returns:
        ???????????????????f?[?^??
        Throws:
        java.io.IOException - ?????????????????G???g????????? ???o???G???[?????????????
      • mark

        public void mark​(int readLimit)
        ?????????????????G???g???????????u???}?[?N?????????A reset() ???}?[?N???????????????u???????????????????B
        Overrides:
        mark in class java.io.InputStream
        Parameters:
        readLimit - ?}?[?N???u???????????E???????????B ?}???o?C?g?????L?????f?[?^???????????????? reset() ????????????????B
        Throws:
        java.lang.IllegalStateException - ?????????????????G???g???????????
      • reset

        public void reset()
                   throws java.io.IOException
        ?????????????????G???g???????????????u???????? mark() ???\?b?h???????o???????????????u???????????B
        Overrides:
        reset in class java.io.InputStream
        Throws:
        java.io.IOException - ?????????????????G???g????????? ???o???G???[?????????????
      • markSupported

        public boolean markSupported()
        ???}???????????X?g???[???? mark()?? reset()???T?|?[?g?????????????B
        ?w?b?_???????????? mark/reset ???K?{?????? ?R???X?g???N?^???n?????? in ?? markSupported() ?? false ???????????A?}???N???X?? in ?? mark/reset ???T?|?[?g???? BufferedInputStream ?????b?v?????B ?????????A?}?????\?b?h?????? true ???????B
        Overrides:
        markSupported in class java.io.InputStream
        Returns:
        ???? true
      • available

        public int available()
                      throws java.io.IOException
        ?????????????????G???g?????I?[???B?????????????B
        ?u???b?N??????????????????f?[?^????????????????????????}???B
        Overrides:
        available in class java.io.InputStream
        Returns:
        ?????????????????G???g?????I?[???B???????? 0 ?B???????????? 1
        Throws:
        java.io.IOException - ?????????????????G???g????????? ???o???G???[?????????????
        See Also:
        ZipInputStream.available()
      • close

        public void close()
                   throws java.io.IOException
        ?}???????X?g???[????????A?g?p??????? ?S???????\?[?X???J???????B
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
        Overrides:
        close in class java.io.InputStream
        Throws:
        java.io.IOException - ???o???G???[?????????????
      • getNextEntry

        public LhaHeader getNextEntry()
                               throws java.io.IOException
        ?????G???g?????????????????????}?????????X?g???[?????????????B
        Returns:
        ?G???g?????????????? LhaHeader
        Throws:
        java.io.IOException - ???o???G???[?????????????
      • getNextEntryWithoutExtract

        public LhaHeader getNextEntryWithoutExtract()
                                             throws java.io.IOException
        ?????G???g????????????????????}?????????X?g???[?????????????B
        Returns:
        ?G???g?????????????? LhaHeader
        Throws:
        java.io.IOException - ???o???G???[?????????????
      • closeEntry

        public void closeEntry()
                        throws java.io.IOException
        ?????????????????G???g????????A ?????G???g?????????}???????????X?g???[?????????????B
        Throws:
        java.io.IOException - ???o???G???[?????????????