Package jp.gr.java_conf.dangan.io
Class LimitedInputStream
- java.lang.Object
-
- java.io.InputStream
-
- jp.gr.java_conf.dangan.io.LimitedInputStream
-
- All Implemented Interfaces:
java.io.Closeable
,java.lang.AutoCloseable
public class LimitedInputStream extends java.io.InputStream
???????????\???f?[?^??????????????????X?g???[???B
-- revision history -- $Log: LimitedInputStream.java,v $ Revision 1.1.2.1 2003/07/20 17:03:37 dangan [maintenance] ???V?? LimitedInputStream ?????\?[?X???????????B Revision 1.1 2002/12/05 00:00:00 dangan [maintenance] ?\?[?X???? Revision 1.0 2002/07/24 00:00:00 dangan add to version control [change] EndOfStream ???B???????? read( new byte[0] ) ?? read( byte[] buf, int off, 0 ) ???????l?? InputStream ??????? 0 ???????????????? [maintenance] ?^?u?p?~ ???C?Z???X????C??
- Version:
- $Revision: 1.1.2.1 $
- Author:
- $Author: dangan $
-
-
Constructor Summary
Constructors Constructor Description LimitedInputStream(java.io.InputStream in, long limit)
in ?????????????????\???f?[?^??????????? ?????X?g???[?????\?z?????B
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
available()
???}???????????X?g???[???????u???b?N??????? ?????????}???????????o?C?g?????????Bvoid
close()
?}???????X?g???[????????A?g?p??????? ?S???????\?[?X???J???????Bvoid
mark(int readLimit)
???}???????????X?g???[???????????u???}?[?N?????????A reset() ???\?b?h???}?[?N???????_?? ???????????u?? ?????????????????Bboolean
markSupported()
???}???????????X?g???[???? mark() ?? reset() ?? ?T?|?[?g?????????????Bint
read()
???}???????????X?g???[?????? 1?o?C?g???f?[?^???????????Bint
read(byte[] buffer)
???}???????????X?g???[?????? buffer ?????????????? ?f?[?^???????????B
?f?[?^???K?????? buffer ????????????????????}?????????Bint
read(byte[] buffer, int index, int length)
???}???????????X?g???[?????? ?o?C?g?z?? buffer ?? index ???w???????????u???? length ?o?C?g???f?[?^?? ?????????B
?f?[?^???K?????? length ?o?C?g???????????????????? ????}?????????Bvoid
reset()
???}???????????X?g???[???????????????u???????? mark() ???\?b?h???????o???????????????u???????????Blong
skip(long length)
???}???????????X?g???[?????f?[?^?? length ?o?C?g???????????B
-
-
-
Method Detail
-
read
public int read() throws java.io.IOException
???}???????????X?g???[?????? 1?o?C?g???f?[?^???????????B- Specified by:
read
in classjava.io.InputStream
- Returns:
- ???????????? 1?o?C?g???f?[?^
????EndOfStream ???B??????????A ??????B?????????? -1 ???????B - Throws:
java.io.IOException
- ???o???G???[?????????????
-
read
public int read(byte[] buffer) throws java.io.IOException
???}???????????X?g???[?????? buffer ?????????????? ?f?[?^???????????B
?f?[?^???K?????? buffer ????????????????????}?????????B- Overrides:
read
in classjava.io.InputStream
- Parameters:
buffer
- ???????????f?[?^???i?[???????????o?C?g?z??- Returns:
- buffer ?????????????f?[?^?????o?C?g?????????B
????EndOfStream ???B??????????A ??????B?????????? -1 ???????B - Throws:
java.io.IOException
- ???o???G???[?????????????
-
read
public int read(byte[] buffer, int index, int length) throws java.io.IOException
???}???????????X?g???[?????? ?o?C?g?z?? buffer ?? index ???w???????????u???? length ?o?C?g???f?[?^?? ?????????B
?f?[?^???K?????? length ?o?C?g???????????????????? ????}?????????B- Overrides:
read
in classjava.io.InputStream
- Parameters:
buffer
- ?????????????f?[?^???i?[???????????o?C?g?z??index
- buffer?????f?[?^?????????J?n???ulength
- buffer???????????f?[?^??- Returns:
- buffer ?????????????f?[?^?????o?C?g?????????B
????EndOfStream ???B??????????A ??????B?????????? -1 ???????B - Throws:
java.io.IOException
- ???o???G???[?????????????
-
skip
public long skip(long length) throws java.io.IOException
???}???????????X?g???[?????f?[?^?? length ?o?C?g???????????B- Overrides:
skip
in classjava.io.InputStream
- Parameters:
length
- ???????????o?C?g???B- Returns:
- ?????????????????????o?C?g???B
- Throws:
java.io.IOException
- ???o???G???[?????????????
-
mark
public void mark(int readLimit)
???}???????????X?g???[???????????u???}?[?N?????????A reset() ???\?b?h???}?[?N???????_?? ???????????u?? ?????????????????B- Overrides:
mark
in classjava.io.InputStream
- Parameters:
readLimit
- ?}?[?N???u???????????E???o?C?g???B ?}???o?C?g?????L?????f?[?^?????? ?????????? reset()?????????????? ?\?????????B
-
reset
public void reset() throws java.io.IOException
???}???????????X?g???[???????????????u???????? mark() ???\?b?h???????o???????????????u???????????B- Overrides:
reset
in classjava.io.InputStream
- Throws:
java.io.IOException
-
- LimitedInputStream ?? mark ???????????????????B
- ???}???????????X?g???[???? markSupported()??
false ???????????B
- ???}???????????X?g???[????
???o???G???[??????????????B
- LimitedInputStream ?? mark ???????????????????B
-
markSupported
public boolean markSupported()
???}???????????X?g???[???? mark() ?? reset() ?? ?T?|?[?g?????????????B- Overrides:
markSupported
in classjava.io.InputStream
- Returns:
- ?X?g???[???? mark() ?? reset() ??
?T?|?[?g?????????? true?B
?T?|?[?g??????????? false?B
-
available
public int available() throws java.io.IOException
???}???????????X?g???[???????u???b?N??????? ?????????}???????????o?C?g?????????B- Overrides:
available
in classjava.io.InputStream
- Returns:
- ?u???b?N????????????o?????o?C?g???B
- Throws:
java.io.IOException
- ???o???G???[?????????????
-
close
public void close() throws java.io.IOException
?}???????X?g???[????????A?g?p??????? ?S???????\?[?X???J???????B- Specified by:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfacejava.io.Closeable
- Overrides:
close
in classjava.io.InputStream
- Throws:
java.io.IOException
- ???o???G???[?????????????
-
-