Interface TsFileOutput

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void close()
      close the output.
      void flush()
      the same with OutputStream.flush().
      long getPosition()
      gets the current position of the Output.
      void truncate​(long size)
      The same with FileChannel.truncate(long).
      java.io.OutputStream wrapAsStream()
      convert this TsFileOutput as a outputstream.
      void write​(byte b)
      Writes 1 byte to this output at the current position.
      void write​(byte[] b)
      Writes b.length bytes from the specified byte array to this output at the current position.
      void write​(java.nio.ByteBuffer b)
      Writes b.remaining() bytes from the specified byte array to this output at the current position.
    • Method Detail

      • write

        void write​(byte[] b)
            throws java.io.IOException
        Writes b.length bytes from the specified byte array to this output at the current position.
        Parameters:
        b - the data.
        Throws:
        java.io.IOException - if an I/O error occurs.
      • write

        void write​(byte b)
            throws java.io.IOException
        Writes 1 byte to this output at the current position.
        Parameters:
        b - the data.
        Throws:
        java.io.IOException - if an I/O error occurs.
      • write

        void write​(java.nio.ByteBuffer b)
            throws java.io.IOException
        Writes b.remaining() bytes from the specified byte array to this output at the current position.
        Parameters:
        b - the data.
        Throws:
        java.io.IOException - if an I/O error occurs.
      • getPosition

        long getPosition()
                  throws java.io.IOException
        gets the current position of the Output. This method is usually used for recording where the data is.
        For example, if the Output is a fileOutputStream, then getPosition returns its file position.
        Returns:
        current position
        Throws:
        java.io.IOException - if an I/O error occurs.
      • close

        void close()
            throws java.io.IOException
        close the output.
        Throws:
        java.io.IOException - if an I/O error occurs.
      • wrapAsStream

        java.io.OutputStream wrapAsStream()
                                   throws java.io.IOException
        convert this TsFileOutput as a outputstream.
        Returns:
        an output stream whose position is the same with this Output
        Throws:
        java.io.IOException - if an I/O error occurs.
      • flush

        void flush()
            throws java.io.IOException
        the same with OutputStream.flush().
        Throws:
        java.io.IOException - if an I/O error occurs.
      • truncate

        void truncate​(long size)
               throws java.io.IOException
        The same with FileChannel.truncate(long).
        Parameters:
        size - size The new size, a non-negative byte count
        Throws:
        java.io.IOException