Class B2ContentFileWriter

  • All Implemented Interfaces:
    B2ContentSink

    public class B2ContentFileWriter
    extends B2ContentWriter
    This is a B2ContentWriter which records the incoming data into a file on disk. It is careful to flush & sync the file when closing it.
    • Method Detail

      • createDestinationOutputStream

        protected java.io.OutputStream createDestinationOutputStream()
                                                              throws java.io.IOException
        Specified by:
        createDestinationOutputStream in class B2ContentWriter
        Returns:
        an outputStream to write to the destination. calling this is allowed to destroy the existing output (if any) and make it impossible for a stream created by createDestinationInputStream() to be able to read the data, if any.
        Throws:
        java.io.IOException - if there's any trouble
      • createDestinationInputStream

        protected java.io.InputStream createDestinationInputStream()
                                                            throws java.io.IOException
        Specified by:
        createDestinationInputStream in class B2ContentWriter
        Returns:
        a new inputStream to read from the destination. this might not contain what you think it should if readContents hasn't completed successfully.
        Throws:
        java.io.IOException - if there's any trouble