Example usage for com.google.common.io LimitInputStream available

List of usage examples for com.google.common.io LimitInputStream available

Introduction

In this page you can find the example usage for com.google.common.io LimitInputStream available.

Prototype

public int available() throws IOException 

Source Link

Usage

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();
}