Java 类io.grpc.KnownLength 实例源码

项目:grpc-java    文件:MessageFramer.java   
private int getKnownLength(InputStream inputStream) throws IOException {
  if (inputStream instanceof KnownLength || inputStream instanceof ByteArrayInputStream) {
    return inputStream.available();
  }
  return -1;
}