类 DataWriter
java.lang.Object
com.ajaxjs.util.io.DataWriter
The writer class for writing data to an output stream.
OutputStream is used for writing raw byte data to a destination like a file, socket, or buffer.
If it does not meet the need, you can refer to the Spring StreamUtils/ResourceUtils/FileCopyUtils/FileSystemUtils.
Please note that this class does not close the output stream.
-
字段概要
字段 -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明voidwrite(byte[] data) Input all the bytes to output stream.voidwrite(byte[] data, int off, int length) Input bytes to output stream.voidwrite(InputStream in) Write data from an input stream to an output stream.
-
字段详细资料
-
BUFFER_SIZE
public static final int BUFFER_SIZE1K 的数据块- 另请参阅:
-
-
构造器详细资料
-
DataWriter
public DataWriter()
-
-
方法详细资料
-
write
Write data from an input stream to an output stream. Please note that the output stream is not closed by this method.- 参数:
in- InputStream, please note that the output stream is not closed by this method.
-
write
public void write(byte[] data, int off, int length) Input bytes to output stream. You can specify a part of the byte[] data.- 参数:
data- Input dataoff- Offset of the byte[] data, it can be zerolength- The length of the byte[] data, it can be zero
-
write
public void write(byte[] data) Input all the bytes to output stream.- 参数:
data- Input data
-