类 DataWriter

java.lang.Object
com.ajaxjs.util.io.DataWriter

public class DataWriter extends Object
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.
  • 字段详细资料

    • BUFFER_SIZE

      public static final int BUFFER_SIZE
      1K 的数据块
      另请参阅:
  • 构造器详细资料

    • DataWriter

      public DataWriter()
  • 方法详细资料

    • write

      public void write(InputStream in)
      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 data
      off - Offset of the byte[] data, it can be zero
      length - 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