List of usage examples for com.squareup.okhttp ResponseBody byteStream
public final InputStream byteStream() throws IOException
From source file:retrofit2.ProtoResponseBodyConverter.java
License:Apache License
@Override public T convert(ResponseBody value) throws IOException { InputStream is = value.byteStream(); try {/*from w ww .j av a 2 s. c o m*/ return parser.parseFrom(is); } catch (InvalidProtocolBufferException e) { throw new RuntimeException(e); // Despite extending IOException, this is data mismatch. } finally { if (is != null) { try { is.close(); } catch (IOException ignored) { } } } }