// Path: BiliLiveLib/src/main/java/charlie/bililivelib/BiliLiveLib.java
// public class BiliLiveLib {
//     public static final String PROJECT_NAME = "BiliLiveLib";
// 
//     public static final String VERSION = "rv5";
//     public static String DEFAULT_USER_AGENT = PROJECT_NAME + " " + VERSION;
// }
// 
// Path: BiliLiveLib/src/test/java/charlie/bililivelib/LogUtil.java
// public class LogUtil {
//     private static final String LINE_BREAKING = System.lineSeparator();
// 
//     private static Logger logger;
// 
//     public static void init() {
//         logger = LogManager.getLogger(BiliLiveLib.class);
//     }
// 
//     public static synchronized void logException(Level level, @NotNull @Nls String message, @NotNull Throwable ex) {
//         if (logger == null) return;
//         logger.log(level, message);
//         StringTokenizer tokenizer = getStackTrace(ex);
//         while(tokenizer.hasMoreTokens()) {
//             logger.log(level, tokenizer.nextToken());
//         }
//     }
// 
//     private static StringTokenizer getStackTrace(Throwable ex) {
//         ByteArrayOutputStream temp = new ByteArrayOutputStream();
//         ex.printStackTrace(new PrintStream(temp));
//         String stackTrace = new String(temp.toByteArray());
//         return new StringTokenizer(stackTrace, LINE_BREAKING);
//     }
// 
//     @Contract(pure = true)
//     private static Logger logger() {
//         return logger;
//     }
// }
// 
// Path: BiliLiveLib/src/main/java/charlie/bililivelib/streamer/event/DownloadEvent.java
// @Getter
// @ToString
// public class DownloadEvent extends EventObject {
//     private String message;
//     private Kind kind;
// 
//     public DownloadEvent(Object source) {
//         super(source);
//         message = "";
//         kind = Kind.OTHER;
//     }
// 
//     public DownloadEvent(Object source, @Nls String message, Kind kind) {
//         super(source);
//         this.message = message;
//         this.kind = kind;
//     }
// 
//     public enum Kind {
//         STARTING, STARTED, STOPPED, LIVE_STOPPED, ERROR, OTHER
//     }
// }
// 
// Path: BiliLiveLib/src/main/java/charlie/bililivelib/streamer/event/DownloadListener.java
// public interface DownloadListener {
//     /**
//      * 在发生事件时调用。
//      * @param event 事件对象
//      */
//     void downloadEvent(DownloadEvent event);
// }


import charlie.bililivelib.BiliLiveLib;
import charlie.bililivelib.LogUtil;
import charlie.bililivelib.streamer.event.DownloadEvent;
import charlie.bililivelib.streamer.event.DownloadListener;
import org.apache.logging.log4j.Level;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.junit.BeforeClass;
import org.junit.Test;
import java.io.File;
import java.net.URL;
package charlie.bililivelib.streamer;



public class DirectStreamDownloaderTest {
    private static final String ADDRESS = "http://cn-cq3-dx.acgvideo.com/vg5/b/08/12352769-1.flv?expires=1481970900&ssig=VF0xLtY-fVWNsCXyl-Belw&oi=3736312299&nfa=jh1gYOK5yu5onKTDA7JgFw==&dynamic=1";

    @BeforeClass
    public static void init() {
// Path: BiliLiveLib/src/main/java/charlie/bililivelib/BiliLiveLib.java
// public class BiliLiveLib {
//     public static final String PROJECT_NAME = "BiliLiveLib";
// 
//     public static final String VERSION = "rv5";
//     public static String DEFAULT_USER_AGENT = PROJECT_NAME + " " + VERSION;
// }
// 
// Path: BiliLiveLib/src/test/java/charlie/bililivelib/LogUtil.java
// public class LogUtil {
//     private static final String LINE_BREAKING = System.lineSeparator();
// 
//     private static Logger logger;
// 
//     public static void init() {
//         logger = LogManager.getLogger(BiliLiveLib.class);
//     }
// 
//     public static synchronized void logException(Level level, @NotNull @Nls String message, @NotNull Throwable ex) {
//         if (logger == null) return;
//         logger.log(level, message);
//         StringTokenizer tokenizer = getStackTrace(ex);
//         while(tokenizer.hasMoreTokens()) {
//             logger.log(level, tokenizer.nextToken());
//         }
//     }
// 
//     private static StringTokenizer getStackTrace(Throwable ex) {
//         ByteArrayOutputStream temp = new ByteArrayOutputStream();
//         ex.printStackTrace(new PrintStream(temp));
//         String stackTrace = new String(temp.toByteArray());
//         return new StringTokenizer(stackTrace, LINE_BREAKING);
//     }
// 
//     @Contract(pure = true)
//     private static Logger logger() {
//         return logger;
//     }
// }
// 
// Path: BiliLiveLib/src/main/java/charlie/bililivelib/streamer/event/DownloadEvent.java
// @Getter
// @ToString
// public class DownloadEvent extends EventObject {
//     private String message;
//     private Kind kind;
// 
//     public DownloadEvent(Object source) {
//         super(source);
//         message = "";
//         kind = Kind.OTHER;
//     }
// 
//     public DownloadEvent(Object source, @Nls String message, Kind kind) {
//         super(source);
//         this.message = message;
//         this.kind = kind;
//     }
// 
//     public enum Kind {
//         STARTING, STARTED, STOPPED, LIVE_STOPPED, ERROR, OTHER
//     }
// }
// 
// Path: BiliLiveLib/src/main/java/charlie/bililivelib/streamer/event/DownloadListener.java
// public interface DownloadListener {
//     /**
//      * 在发生事件时调用。
//      * @param event 事件对象
//      */
//     void downloadEvent(DownloadEvent event);
// }


// Path: BiliLiveLib/src/test/java/charlie/bililivelib/streamer/DirectStreamDownloaderTest.java
import charlie.bililivelib.BiliLiveLib;
import charlie.bililivelib.LogUtil;
import charlie.bililivelib.streamer.event.DownloadEvent;
import charlie.bililivelib.streamer.event.DownloadListener;
import org.apache.logging.log4j.Level;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.junit.BeforeClass;
import org.junit.Test;
import java.io.File;
import java.net.URL;

package charlie.bililivelib.streamer;



public class DirectStreamDownloaderTest {
    private static final String ADDRESS = "http://cn-cq3-dx.acgvideo.com/vg5/b/08/12352769-1.flv?expires=1481970900&ssig=VF0xLtY-fVWNsCXyl-Belw&oi=3736312299&nfa=jh1gYOK5yu5onKTDA7JgFw==&dynamic=1";

    @BeforeClass
    public static void init() {
        LogUtil.init();