Class StringMediaReader
java.lang.Object
cool.scx.http.media.string.StringMediaReader
- All Implemented Interfaces:
MediaReader<String>
1, 如果未指定字符集则 使用 请求头中的字符集 如果请求头中的字符集为空则回退到 UTF_8
2, 如果指定字符集 忽略 请求头中的字符集
- Version:
- 0.0.1
- Author:
- scx567888
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Charsetread(cool.scx.io.ByteInput byteInput, ScxHttpHeaders headers) 读取内容
-
Field Details
-
STRING_MEDIA_READER
常用情况 特殊情况直接 new
-
-
Constructor Details
-
StringMediaReader
-
-
Method Details
-
getContentTypeCharsetOrUTF8
-
read
public String read(cool.scx.io.ByteInput byteInput, ScxHttpHeaders headers) throws cool.scx.io.exception.ScxIOException, cool.scx.io.exception.AlreadyClosedException Description copied from interface:MediaReader读取内容- Specified by:
readin interfaceMediaReader<String>- Parameters:
byteInput- 输入流headers- 请求头 (在客户端状态下是 responseHeaders)- Throws:
cool.scx.io.exception.ScxIOExceptioncool.scx.io.exception.AlreadyClosedException
-