List of usage examples for com.google.common.io LimitInputStream available
public int available() throws IOException
From source file:com.comphenix.protocol.compat.netty.shaded.ShadedByteBufAdapter.java
@Override public int setBytes(int index, InputStream in, int length) throws IOException { LimitInputStream limit = new LimitInputStream(in, length); ByteStreams.copy(limit, output);/*from w w w . j a va 2s . co m*/ return length - limit.available(); }