Class LhaInputStream

java.lang.Object
java.io.InputStream
jp.gr.java_conf.dangan.util.lha.LhaInputStream
All Implemented Interfaces:
Closeable, AutoCloseable

public class LhaInputStream extends 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
    in ???? LHA???????f?[?^?????????? InputStream ???\?z?????B
    ?e???k?`?????????????????????????????????v???p?e?B???? LhaProperty.getProperties() ???????????v???p?e?B???g?p???????B
    in ???? LHA???????f?[?^?????????? InputStream???\?z?????B
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    ?????????????????G???g?????I?[???B?????????????B
    ?u???b?N??????????????????f?[?^????????????????????????}???B
    void
    ?}???????X?g???[????????A?g?p??????? ?S???????\?[?X???J???????B
    void
    ?????????????????G???g????????A ?????G???g?????????}???????????X?g???[?????????????B
    ?????G???g?????????????????????}?????????X?g???[?????????????B
    ?????G???g????????????????????}?????????X?g???[?????????????B
    void
    mark(int readLimit)
    ?????????????????G???g???????????u???}?[?N?????????A reset() ???}?[?N???????????????u???????????????????B
    boolean
    ???}???????????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
    ???????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
    ?????????????????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.lang.Object

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

    • LhaInputStream

      public LhaInputStream(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:
    • LhaInputStream

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

    • read

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

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

      public int read(byte[] buffer, int index, int length) throws IOException
      ???????G???g?????? buffer ??index?? length?o?C?g?? ?f?[?^?????????????B
      Overrides:
      read in class 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:
      IOException - ?????????????????G???g????????? ???o???G???[?????????????
    • skip

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

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

      public void reset() throws IOException
      ?????????????????G???g???????????????u???????? mark() ???\?b?h???????o???????????????u???????????B
      Overrides:
      reset in class InputStream
      Throws:
      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 InputStream
      Returns:
      ???? true
    • available

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

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

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

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

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