Java tutorial
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package epgtools.dumpepgfromts.test.common; import libepg.epg.section.Section; import org.apache.commons.codec.DecoderException; import org.apache.commons.codec.binary.Hex; /** * ?SDT * * @author normal */ public final class TestSection { public static final String TEST_SDT_1 = "46f0fe4750fb00000004ff00fcff10ed4820010e0e494d41474943410f21210e54560f1b7ca4deb8ab0e4253fe0f31473268c10184cb300005130010402805170411a80ccb5ae8174b877da3174113edead4a588ad359d478b0f1505faac0d5fc4f5c135f787004a9446b1000403480318b3ce48564148f2b44d77a4bfc0afcbcfb43243467eac492c4d57c7b90daa3f3d397edfcf1b7cb9abd1f90e211b7ddec70d0f21581b7cb9abd1f921591b7dc738213a770daa45454f43cae90d890e303132302d3131332d3333308a2f8931308a0f2141890e32308a0f3b7e0d0e2a0f3a23c0b13243467e4e41890e308a0f315f0e2189338a0f376e4b76dec79d455353"; public static final String TEST_SDT_2 = "46f13646b1c100000004ff00f1ff10e3481501081b7cb9abd1f90e210a0e42531b7cb9abd1f921c10184cb310005140010114028051704e2d21356ca2e1fa4a74fe1df0c2d6bebb40401004212bab8e1fed64092d330364ca37885cb004a9446b1000403480318b3ce48564148f2b44d77a4bfc0afcbcfb43243467eac492c4d57c7b90daa3f3d397edfcf1b7cb9abd1f90e211b7ddec70d0f21581b7cb9abd1f921591b7dc738213a770daa45454f43cae90d890e303132302d3131332d3333308a2f8931308a0f2141890e32308a0f3b7e0d0e2a0f3a23c0b13243467e4e41890e308a0f315f0e2189338a0f376e4b76dec70348ff001b4816c0081b7cb9abd1f90e210b1b7cb9abd1f90e21aca4c9c101040349ff001d4818c0081b7cb9abd1f90e210d0e42531b7cb9abd1f921c7f9bfc1010402ee209d"; public static final String TEST_SDT_3_CRCERROR = "46f13646b1c100000004ff00f1ff10e3481501081b7cb9abd1f90e210a0e42531b7cb9abd1f921c10184cb310005140010114028051704e2d21356ca2e1fa4a74fe1df0c2d6bebb40401004212bab8e1fed64092d330364ca37885cb004a9446b1000403480318b3ce48564148f2b44d77a4bfc0afcbcfb43243467eac492c4d57c7b90daa3f3d397edfcf1b7cb9abd1f90e211b7ddec70d0f21581b7cb9abd1f921591b7dc738213a770daa45454f43cae90d890e303132302d3131332d3333308a2f8931308a0f2141890e32308a0f3b7e0d0e2a0f3a23c0b13243467e4e41890e308a0f315f0e2189338a0f376e4b76dec70348ff001b4816c0081b7cb9abd1f90e210b1b7cb9abd1f90e21aca4c9c101040349ff001d4818c0081b7cb9abd1f90e210d0e42531b7cb9abd1f921c7f9bfc1010402eeff9d"; public static final String TEST_EIT_1 = "61f21e00c9ed28f844700004286195f0e08015200000100000ad4d866a706e2a1b242a3b1b7dfae5891b7ec9ce20c6cfc3d5d38abcc1cecec9c5af1b7ca2cb213c1b7ea8b2b0b1b4a9be573d5031693c54e434464644d8ce1b7ca4f3bfd3e5213c2122e1a4adf3b03147417c1b7dcac921223a6e494ace382bc9b3edf2e2eac0afb5f3cb3e52327021234a7c41773a6e494ac8a2efbbc6aa335ab7df323cb5a42123500af1b3006a706e3147417c540427ff60ffc102a436c40df203100fff5f656e67323b403c95fae08015300002100010884d506a706e201b242a3b1b7dfae4fadd1b7ec1cecec9c5af1b7ca2cb213c1b7ea8b2b0b1b4a92b215a3f37356c1b7cdfe5213cb8abeb314732681b7ed3c8cfd7215b215a382b1b7dafe9d91b7cb7cdde215b500af1b3006a706e3147417c540260ffc102a436c40df209100fff5f656e67323b403ccb11000513001038090503026485ae2651590096cce08017400001400010b64d7e6a706e1c1b242a3b1b7dfae41b7ce9b9c82126a2e1eaabf32126d2213ced213c5d215a40443d55215b41344a46cbbdce4c3ef2434ee9ecbf3c423a5fce1b7cec213cb5213c2122b8e5cba22126b8e7f3bdf31b7dce3c63ad467cf221221b7cb8a7d52126d6eac3b8ba3c6731691b7dc73e7034364b2dabcb4941ad3d50b9500af1b3006a706e3147417c540260ffc102a436c40df201100fff6f656e67323b403ccb11000513001038090503026485ae2651590046976e2c"; private static Section getSdt(String sdtHexDump) throws DecoderException { char[] xc = sdtHexDump.toCharArray(); byte[] xb = Hex.decodeHex(xc); return new Section(xb); } public static Section getSdt1() throws DecoderException { return getSdt(TestSection.TEST_SDT_1); } public static Section getSdt2() throws DecoderException { return getSdt(TestSection.TEST_SDT_2); } public static Section getSdt3_CRCERROR() throws DecoderException { return getSdt(TestSection.TEST_SDT_3_CRCERROR); } public static Section getEit1() throws DecoderException { return getSdt(TestSection.TEST_EIT_1); } private TestSection() { } }