Example usage for org.apache.cordova.squareup.okhttp.internal Util readFully

List of usage examples for org.apache.cordova.squareup.okhttp.internal Util readFully

Introduction

In this page you can find the example usage for org.apache.cordova.squareup.okhttp.internal Util readFully.

Prototype

public static void readFully(InputStream in, byte[] dst) throws IOException 

Source Link

Document

Fills 'dst' with bytes from 'in', throwing EOFException if insufficient bytes are available.

Usage

From source file:com.squareup.okhttp.internal.spdy.NameValueBlockReader.java

License:Apache License

private String readString() throws DataFormatException, IOException {
    int length = nameValueBlockIn.readInt();
    byte[] bytes = new byte[length];
    Util.readFully(nameValueBlockIn, bytes);
    return new String(bytes, 0, length, "UTF-8");
}