public class Media extends Object
| Constructor and Description |
|---|
Media(byte[] body) |
Media(byte[] body,
String contentType) |
Media(InputStream body) |
Media(InputStream body,
String contentType) |
Media(InputStream body,
String contentType,
long contentSize) |
Media(String body) |
Media(String body,
String contentType) |
| Modifier and Type | Method and Description |
|---|---|
InputStream |
body()
主体
|
byte[] |
bodyAsBytes()
主体转为字节数组
|
byte[] |
bodyAsBytes(boolean autoClose) |
String |
bodyAsString()
主体转为字符串
|
String |
bodyAsString(boolean autoClose) |
long |
contentSize() |
String |
contentType()
内容类型
|
public Media(InputStream body, String contentType)
public Media(InputStream body, String contentType, long contentSize)
public Media(InputStream body)
public Media(byte[] body,
String contentType)
public Media(byte[] body)
public Media(String body)
public String contentType()
public long contentSize()
throws IOException
IOExceptionpublic InputStream body()
public byte[] bodyAsBytes()
public byte[] bodyAsBytes(boolean autoClose)
public String bodyAsString()
public String bodyAsString(boolean autoClose)
Copyright © 2025. All rights reserved.