larksuite-oapi/src/main/java/com/larksuite/oapi/okhttp3_14/RequestBody.java
public static RequestBody create(final @Nullable MediaType contentType, final File file) {
    if (file == null) throw new NullPointerException("file == null");

    return new RequestBody() {
      @Override public @Nullable
      MediaType contentType() {
        return contentType;
      }

      @Override public long contentLength() {
        return file.length();
      }

      @Override public void writeTo(BufferedSink sink) throws IOException {
        try (Source source = Okio.source(file)) {
          sink.writeAll(source);
        }
      }
    };
  }
/** Returns a new request body that transmits the content of {@code file}. */
Returns a new request body that transmits the content of  file.
Returns a new request body that transmits the content of file .
public static RequestBody create(final @Nullable MediaType contentType, final File file) {
    if (file == null) throw new NullPointerException("file == null");
    return new RequestBody() {
      @Override public @Nullable
      MediaType contentType() {
        return contentType;
      }
      @Override public long contentLength() {
        return file.length();
      }
      @Override public void writeTo(BufferedSink sink) throws IOException {
        try (Source source = Okio.source(file)) {
          sink.writeAll(source);
        }
      }
    };
  }
public static RequestBody create ( final @ Nullable MediaType contentType , final File file ) { if ( file == null ) throw new NullPointerException ( "file == null" ) ; return new RequestBody ( ) { @ Override public @ Nullable MediaType contentType ( ) { return contentType ; } @ Override public long contentLength ( ) { return file . length ( ) ; } @ Override public void writeTo ( BufferedSink sink ) throws IOException { try ( Source source = Okio . source ( file ) ) { sink . writeAll ( source ) ; } } } ; }
Returns a new request body that transmits the content of {@code file}.
Returns a new request body that transmits the content of { @code file } .