mirror of
https://github.com/mamoe/mirai.git
synced 2025-03-05 00:10:13 +08:00
Fix typo of ExternalResource
This commit is contained in:
parent
4c600f9ded
commit
1688dc9453
@ -66,12 +66,10 @@ import kotlin.contracts.contract
|
||||
* }
|
||||
* ```
|
||||
*
|
||||
* 注意, 若使用 [InputStream], 必须手动关闭 [InputStream]. 一种使用情况示例:
|
||||
*
|
||||
* ## 在 Java 获得和使用 [ExternalResource] 实例
|
||||
*
|
||||
* ```
|
||||
* try(ExternalResource resource = ExternalResource.create(file)) { // 使用文件 file
|
||||
* try (ExternalResource resource = ExternalResource.create(file)) { // 使用文件 file
|
||||
* contact.uploadImage(resource); // 用来上传图片
|
||||
* contact.files.uploadNewFile("/foo/test.txt", file); // 或者用来上传文件
|
||||
* }
|
||||
@ -80,8 +78,8 @@ import kotlin.contracts.contract
|
||||
* 注意, 若使用 [InputStream], 必须手动关闭 [InputStream]. 一种使用情况示例:
|
||||
*
|
||||
* ```java
|
||||
* try(InputStream stream = ...) { // 安全地使用 InputStream
|
||||
* try(ExternalResource resource = ExternalResource.create(stream)) { // 安全地使用资源
|
||||
* try (InputStream stream = ...) { // 安全地使用 InputStream
|
||||
* try (ExternalResource resource = ExternalResource.create(stream)) { // 安全地使用资源
|
||||
* contact.uploadImage(resource); // 用来上传图片
|
||||
* contact.files.uploadNewFile("/foo/test.txt", file); // 或者用来上传文件
|
||||
* }
|
||||
|
Loading…
Reference in New Issue
Block a user