package com.dowse.camera.client.video;

import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;

/* loaded from: ds_camera_client-2.0.6-23030810.aar:classes.jar:com/dowse/camera/client/video/DSH264FileUtil.class */
public class DSH264FileUtil {
    private OutputStream outputStream;
    private String h264Path;

    public DSH264FileUtil(String h264Path) {
        this.h264Path = "";
        this.h264Path = h264Path;
        File h264File = new File(this.h264Path);
        try {
            this.outputStream = new FileOutputStream(h264File);
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        }
    }

    public void stopWrite() {
        if (this.outputStream != null) {
            try {
                this.outputStream.flush();
                this.outputStream.close();
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
    }

    public void writeData(byte[] data) {
        if (this.outputStream != null) {
            try {
                this.outputStream.write(data, 0, data.length);
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
    }
}
