public final class LimitedInputStream extends InputStream
| Constructor and Description |
|---|
LimitedInputStream(InputStream underlyingStream,
long limit) |
| Modifier and Type | Method and Description |
|---|---|
int |
available()
返回可从此输入流读取(或跳过)而不会阻塞的字节数的估计值。
该值是底层流的可用字节数和此流剩余限制之间的较小者。
|
void |
close() |
boolean |
isClosed() |
int |
read() |
int |
read(byte[] b,
int off,
int len) |
mark, markSupported, read, reset, skippublic LimitedInputStream(InputStream underlyingStream, long limit)
public int read()
throws IOException
read in class InputStreamIOExceptionpublic int read(byte[] b,
int off,
int len)
throws IOException
read in class InputStreamIOExceptionpublic int available()
throws IOException
available in class InputStreamIOException - 如果发生 I/O 错误。public void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableclose in class InputStreamIOExceptionpublic boolean isClosed()
Copyright © 2026 Alibaba Cloud Computing. All rights reserved.