@@ -0,0 +1,1179 @@
+package de.tblsoft.pcap;%0A%0Aimport com.google.common.io.ByteStreams;%0Aimport org.junit.Ignore;%0A%0Aimport java.io.BufferedInputStream;%0Aimport java.io.FileInputStream;%0Aimport java.io.InputStream;%0A%0A/**%0A * http://www.kroosec.com/2012/10/a-look-at-pcap-file-format.html%0A * Created by oelbaer on 01.05.16.%0A */%0Apublic class PcapTest %7B%0A    @org.junit.Test%0A    @Ignore%0A    public void test() throws Exception %7B%0A        String file = %22/tmp/artifacts/output.pcap%22;%0A        InputStream input = new BufferedInputStream(new FileInputStream(file));%0A        byte%5B%5D bytes = ByteStreams.toByteArray(input);%0A%0A        byte%5B%5D magicNumber = new byte%5B4%5D;%0A        System.arraycopy(bytes,0,magicNumber,0,4);%0A        magicNumber(magicNumber);%0A%0A%0A        byte%5B%5D version = new byte%5B4%5D;%0A        System.arraycopy(bytes,4,version,0,4);%0A        magicNumber(version);%0A%0A    %7D%0A%0A    void version(byte%5B%5D version) %7B%0A        printHex(version);%0A%0A    %7D%0A%0A%0A    void magicNumber(byte%5B%5D magicNumber) %7B%0A        printHex(magicNumber);%0A%0A    %7D%0A%0A    void printHex(byte%5B%5D b) %7B%0A        for (int i = 0; i %3C b.length; i++) %7B%0A            String p = String.format(%22%2502X %22, b%5Bi%5D);%0A            System.out.print(p + %22 %22);%0A%0A        %7D%0A%0A    %7D%0A%0A%0A%7D%0A

add pcap test