larksuite-oapi/src/main/java/com/larksuite/oapi/okhttp3_14/ResponseBody.java
public final byte[] bytes() throws IOException {
    long contentLength = contentLength();
    if (contentLength > Integer.MAX_VALUE) {
      throw new IOException("Cannot buffer entire body for content length: " + contentLength);
    }

    byte[] bytes;
    try (BufferedSource source = source()) {
      bytes = source.readByteArray();
    }
    if (contentLength != -1 && contentLength != bytes.length) {
      throw new IOException("Content-Length ("
          + contentLength
          + ") and stream length ("
          + bytes.length
          + ") disagree");
    }
    return bytes;
  }
/**
   * Returns the response as a byte array.
   *
   * <p>This method loads entire response body into memory. If the response body is very large this
   * may trigger an {@link OutOfMemoryError}. Prefer to stream the response body if this is a
   * possibility for your response.
   */
Returns the response as a byte array.
This method loads entire response body into memory. If the response body is very large this
may trigger an  OutOfMemoryError. Prefer to stream the response body if this is a
possibility for your response.
Returns the response as a byte array . This method loads entire response body into memory . If the response body is very large this may trigger an OutOfMemoryError . Prefer to stream the response body if this is a possibility for your response .
public final byte[] bytes() throws IOException {
    long contentLength = contentLength();
    if (contentLength > Integer.MAX_VALUE) {
      throw new IOException("Cannot buffer entire body for content length: " + contentLength);
    }
    byte[] bytes;
    try (BufferedSource source = source()) {
      bytes = source.readByteArray();
    }
    if (contentLength != -1 && contentLength != bytes.length) {
      throw new IOException("Content-Length ("
          + contentLength
          + ") and stream length ("
          + bytes.length
          + ") disagree");
    }
    return bytes;
  }
public final byte [ ] bytes ( ) throws IOException { long contentLength = contentLength ( ) ; if ( contentLength > Integer . MAX_VALUE ) { throw new IOException ( "Cannot buffer entire body for content length: " + contentLength ) ; } byte [ ] bytes ; try ( BufferedSource source = source ( ) ) { bytes = source . readByteArray ( ) ; } if ( contentLength != - 1 && contentLength != bytes . length ) { throw new IOException ( "Content-Length (" + contentLength + ") and stream length (" + bytes . length + ") disagree" ) ; } return bytes ; }
Returns the response as a byte array.
Returns the response as a byte array .