Package org.aoju.bus.core.io.stream
Class StreamWriter
java.lang.Object
org.aoju.bus.core.io.stream.StreamWriter
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StreamWriterof(OutputStream out, boolean closeAfterWrite) 创建写出器voidwrite(byte[] content) 将byte[]写到流中voidwriteObject(Object... contents) 将多部分对象写到流中,使用ObjectOutputStream,对象必须实现序列化接口voidwriteString(Charset charset, Object... contents) 将多部分内容写到流中,自动转换为字符串
-
Constructor Details
-
StreamWriter
构造- Parameters:
out-OutputStreamcloseAfterWrite- 写出结束后是否关闭流
-
-
Method Details
-
of
创建写出器- Parameters:
out-OutputStreamcloseAfterWrite- 写出结束后是否关闭流- Returns:
- StreamReader
-
write
将byte[]写到流中- Parameters:
content- 写入的内容- Throws:
InternalException- IO异常
-
writeObject
将多部分对象写到流中,使用ObjectOutputStream,对象必须实现序列化接口- Parameters:
contents- 写入的内容- Throws:
InternalException- IO异常
-
writeString
将多部分内容写到流中,自动转换为字符串- Parameters:
charset- 写出的内容的字符集contents- 写入的内容,调用toString()方法,不包括不会自动换行- Throws:
InternalException- IO异常
-