public class RateLimitInputStream extends InputStream
Constructor and Description |
---|
RateLimitInputStream(InputStream inputStream,
com.google.common.util.concurrent.RateLimiter... rateLimiters)
Constructs a new
RateLimitInputStream . |
Modifier and Type | Method and Description |
---|---|
void |
close() |
int |
read() |
int |
read(byte[] b) |
int |
read(byte[] b,
int off,
int len) |
available, mark, markSupported, reset, skip
public RateLimitInputStream(InputStream inputStream, com.google.common.util.concurrent.RateLimiter... rateLimiters)
RateLimitInputStream
.inputStream
- Original stream to be limitedrateLimiters
- RateLimiters to limit Maximal reading bytes per secondpublic int read() throws IOException
read
in class InputStream
IOException
public int read(byte[] b) throws IOException
read
in class InputStream
IOException
public int read(byte[] b, int off, int len) throws IOException
read
in class InputStream
IOException
public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
close
in class InputStream
IOException
Copyright © 2023. All Rights Reserved.