• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java IOUtils类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.red5.io.utils.IOUtils的典型用法代码示例。如果您正苦于以下问题:Java IOUtils类的具体用法?Java IOUtils怎么用?Java IOUtils使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



IOUtils类属于org.red5.io.utils包,在下文中一共展示了IOUtils类的19个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: testDecodeBuffer

import org.red5.io.utils.IOUtils; //导入依赖的package包/类
@Test
public void testDecodeBuffer() {
    log.debug("\ntestDecodeBuffer");
    RTMPProtocolDecoder dec = new RTMPProtocolDecoder();
    List<Object> objs;
    RTMPConnection conn = new RTMPMinaConnection();
    conn.getState().setState(RTMP.STATE_CONNECTED);
    conn.setHandler(this);
    IoBuffer p00 = IoBuffer
            .wrap(IOUtils
                    .hexStringToByteArray("8639ae8685ad4e802fb905a7918b480416b013e0632e41773e6ba30a1ee089ddb94df6eff6b59aa6251a2707215a2907dc6b51a749ff6680b37792b6c302d43e80f4780361ab7b3c79de5f917aece673e6192e0d45606a5a56dc23ee8113b3381a5d428074f461db71f8caaefa650517809b63edc8412c1f88b4e4d43584ca491a89dfdbb78df1b00c1cedc8e2139fe831becd70527adf4d17760c1cbfff47a1116aaa8f603d3f5319a0688bbc215c1cae1cfb06b6546abd4b76cc7f32cbc84b4531ba2f539d6ae5c4c081bcc51a73b7c14881f8b6bddb480d8a4430b98577f15d31215480d6ebb9cb56931ad3703c2bf024c943b3c45c18717d467387141cdcc88f389548bc335b10ead0daf8e8c69e67f43099ab1f5f2afcb343c08d4b065ec7ce3a437d9891ec8388155d5bdae8dcfd6b4419df2d9c7ca584511e240cc6b1f04ccc098a74d5037c921e4f5916affa17ff71daed20d621687b12bd3f7fcb8f538360b39eb237ca05ada13dc433dc10c2504c55e5ca2e6528b3279eb49e4629218acfc33fce315c58533076d7e3fff6e49650d4283c8fa4ee766f93fc3d10b10bd10b8c2393e2a1da4e6c53dcc5ddbd6efd7b844b7546b0472346b9229cdb6e8d45f70f1e6d23b96cbb2c41fcd486e25fef021e19568c4617248e58ca195fb7aad5ca34dcf27ac7f03dc71a8b4831d1bbb273f6bba56ed9cdf49eef6c45df5071d19d9e8e23fb33b34a65648141cd61db72f79fa7944e3232cd8e30ba310d566fdac6d51b683a3c27af315ca5dc0f614d62c6672e97c036d181e00d6cf08b41a130d7a24783ad616593dc10753959529657f94aec63fa073ae24afe44b2d7075164ebc25305db954607b92c1c7ded5f88e587227ce411010292b6e392aeaeca456d64dadec73cac5de51ec2d3b530db0cdb9869fbdabe1f0aae10bcc1479dc927178a323ac0b2c1def11a086605ee0a66d5a9f1652b5b5860cdbd3594c8e2511c004d8704ccb2732197f37e687753ce0ed00717f20ca6e7076fd4d06b49ba8c665a2adc41e702753225868ace398baebb6944c29c149b838fb71b1e8c20ed3c9561129867c56bc800be10f8dba659f37bbe2242b0cbdcf342396e5ee61f327e7759500d4647e313937c81809b602af08493812ca199698ed35de9ebeded83e1ef5d8f8ad56c368acd7a6d7a05118541bf9d60bc3e45d64431a7700770c814f48f5dcd1c35270a5288b8cbde9333b5b8c40dfd6f0d31d51bea52e0bc6e6e4f46b1bfe85268a494a83d20668829dcfa492325e5f372f45a74bc19c9be07eda5bb1060376b0563081f541801b7d7ce5f7408e5bb11f63d0638419f7cb8aaaa55afa32dfb1e4f0df11fc355ad6c30405b8824f8fff87feeb3b5390cde76040008bb422200a571cd0c19fda9df620ad6ca881c833728081e7cefecc78b280cc06b4c7de3d1c9cebc04d84e1c43fb9fc8b52cc07e0eb15012872c0739322b1da9d7888b6c0f968863ac571837fd63457f98d574665e3cbe1f3b497fb03d1ab8e481985732de26051919d0aba7f18281d8f512b05a625746e4dd50e0c4be16ab4b59aa3cf24e1648ee9d74e4f3b2a92fc7828a5eb2040a706d52e354fb079df3062d404c46fb78de4931caac381020c5bf6b38fecdc5f7d66c3ea3fb087f4ed8ac98a81a24a42053282c7524c2953a5885c1ff5d736d46c472d318312f2a427dc3526fd513c88dbb8583d607031c0a2825f9e74428b859d8874e0cb013b458b27d549a41e4330682dac90e073b79c458dcb2cba317f816bd2dabdcee96d77ab6466021a23a932d134ba33279956aae938787a3a59216b53d50dc0554fe34b5f51d1e050f84e03a7442b29604684291a2ee79198a3911f8a54a1e47c0bf9ec25114f60dae43d4aa4639e5a5c89010ba3884014c2721cab878795f22ba8136f7d4685c9a5c348bda08b60a1ff1afe6d5578d52f5051eeafa9e3b9501701a272a880aaeb30fbc2db66a5e48d7c811a56c9a809c92567d8a10472c142f3dc38c0123e20ed3feb067a550e0a997b38061e191a3bb5b47a04ef70fdd94e69bfc9be160d8a8cc7dc163e8d595cc987c1d676a7b543f56305be60921c19113be5ea988c864b636e216c1c6d71319e0c96b58eb619ac63016ffb97761b79a3eea0016cfacadc7c10300000100014d1400000000020007636f6e6e656374003ff0000000000000030003617070020003766f640008666c61736856657202000e4c4e582032302c302c302c323836000673776655726c020036687474703a2f2f6c6f63616c686f73743a353038302f766f642f6d696e69706c617965722e7377662f5b5b44594e414d49435d5d2f320005746355c3726c02001972746d703a2f2f6c6f63616c686f73743a313933352f766f640004667061640100000c6361706162696c697469657300406de00000000000000b617564696f436f646563730040abee0000000000000b766964656f436f6465637300406f800000000000000d766964656f46756e6374696f6e003ff00000000000c30000077061676555726c020024687474703a2f2f6c6f63616c686f73743a353038302f766f642f696e6465782e68746d6c000e6f626a656374456e636f64696e67004008000000000000000009"));
    p00.position(1536);
    objs = dec.decodeBuffer(conn, p00);
    log.debug("Objects #00: {}", objs);
    assertNotNull("Objects should not be null", objs);
    assertFalse("Objects should not be empty", objs.isEmpty());
    assertEquals("Method should be 'connect'", "connect", ((Invoke) ((Packet) objs.get(0)).getMessage()).getCall().getServiceMethodName());

    IoBuffer p01 = IoBuffer
            .wrap(IOUtils
                    .hexStringToByteArray("030000000001431400000000020007636f6e6e656374003ff0000000000000030003617070020003766f640008666c61736856657202000e4c4e582032302c302c302c323836000673776655726c020036687474703a2f2f6c6f63616c686f73743a353038302f766f642f6d696e69706c617965722e7377662f5b5b44594e414d49435d5d2f320005746355c3726c02001972746d703a2f2f6c6f63616c686f73743a313933352f766f640004667061640100000c6361706162696c697469657300406de00000000000000b617564696f436f646563730040abee0000000000000b766964656f436f6465637300406f800000000000000d766964656f46756e6374696f6e003ff00000000000c30000077061676555726c02001a687474703a2f2f6c6f63616c686f73743a353038302f766f642f000e6f626a656374456e636f64696e6700400800000000000000000902fffe410000040500000000009896800300003100001a11000000000002000c63726561746553747265616d00400000000000000005"));
    objs = dec.decodeBuffer(conn, p01);
    log.debug("Objects #01: {}", objs);
}
 
开发者ID:Red5,项目名称:red5-server-common,代码行数:25,代码来源:TestRTMPProtocolDecoder.java


示例2: testServerDigest

import org.red5.io.utils.IOUtils; //导入依赖的package包/类
@Test
public void testServerDigest() throws InterruptedException {
    log.info("\n testServerDigest");
    IoBuffer r5c1 = IoBuffer.allocate(1536);
    r5c1.put(IOUtils.hexStringToByteArray(red5clientC1));
    r5c1.flip();
    InboundHandshake in = new InboundHandshake();
    in.decodeClientRequest1(r5c1);
    int algorithm = 0;
    byte[] handshakeBytes = in.getHandshakeBytes();
    // get the handshake digest
    int digestPos = in.getDigestOffset(algorithm, handshakeBytes, 0);
    log.debug("Digest position offset: {}", digestPos);
    in.calculateDigest(digestPos, handshakeBytes, 0, RTMPHandshake.GENUINE_FMS_KEY, 36, handshakeBytes, digestPos);
    log.debug("Calculated digest: {}", Hex.encodeHexString(Arrays.copyOfRange(handshakeBytes, digestPos, digestPos + 32)));
    Assert.assertTrue(in.verifyDigest(digestPos, handshakeBytes, RTMPHandshake.GENUINE_FMS_KEY, 36));
}
 
开发者ID:Red5,项目名称:red5-server,代码行数:18,代码来源:ServerRTMPHandshakeTest.java


示例3: testValidateFromBrowsers

import org.red5.io.utils.IOUtils; //导入依赖的package包/类
@Test
public void testValidateFromBrowsers() {
    log.info("\n testValidateFromBrowsers");
    // no handshake type bytes are included here, the C0
    // server side handshake handler
    InboundHandshake in = new InboundHandshake();
    // CHROME
    IoBuffer cc = IoBuffer.allocate(1536);
    cc.put(IOUtils.hexStringToByteArray(chromeFlashPlayerC1));
    cc.flip();
    log.debug("Validate chrome: {}", cc);
    boolean chrome = in.validate(cc.array());
    cc.clear();
    // FIREFOX
    cc.put(IOUtils.hexStringToByteArray(firefoxFlashPlayerC1));
    cc.flip();
    log.debug("Validate firefox: {}", cc);
    boolean firefox = in.validate(cc.array());
    cc.clear();
    Assert.assertTrue(chrome && firefox);
}
 
开发者ID:Red5,项目名称:red5-server,代码行数:22,代码来源:ServerRTMPHandshakeTest.java


示例4: testDecodeBufferExTS

import org.red5.io.utils.IOUtils; //导入依赖的package包/类
@Test
public void testDecodeBufferExTS() {
    //log.debug("\testDecodeBufferExTS");
    RTMPProtocolDecoder dec = new RTMPProtocolDecoder();
    RTMPConnection conn = new RTMPMinaConnection();
    Red5.setConnectionLocal(conn);
    RTMP rtmp = conn.getState();
    rtmp.setState(RTMP.STATE_CONNECTED);
    // lastHeader: Header [streamId=1, channelId=4, dataType=18, timerBase=0, timerDelta=0, size=309, extended=false]
    // get the local decode state
    RTMPDecodeState state = conn.getDecoderState();
    // meta and audio 4x chunks
    IoBuffer in = IoBuffer.wrap(IOUtils.hexStringToByteArray("04000000000135120100000002000d40736574446174614672616d6502000a6f6e4d65746144617461080000000d00086475726174696f6e0040d518000000000000057769647468004064000000000000000668656967687400405e000000000000000d766964656f64617461726174650040686a000000000000096672616d657261746500403900000000c40000000c766964656f636f6465636964004000000000000000000d617564696f6461746172617465000000000000000000000f617564696f73616d706c65726174650040d5888000000000000f617564696f73616d706c6573697a65004030000000000000000673746572656f0100000c617564696f636f6465636964004000c40000000000000007656e636f64657202000d4c61766635362e31352e313032000866696c6573697a650000000000000000000000090400000000006908010000002afff340c400104002e62d4110009080200830107ea04cfa810710e0987f820ec130fc401897c1c0c70ff502008020eea04c1f0fe7fcb9fc10ff90d107c1f82008021feb07c1c04010041c20f89c1fff6b6edad93d99d8da6cd42a08e459095589d4b5fb9a4e679a1f4400001a00006a082afff342c41a19c91f225d89300055a47640c62cee7ccc85c08c42cadb6b56daebe65989f78c3ef3cfbd694ac0c34aa855ee0598a031f0a0686212d43631a4c59a926383c2d5201c5e9b7377"));
    Packet packet = null;
    do {
        packet = dec.decodePacket(conn, state, in);
    } while (packet == null);
    assertNotNull(packet);
    assertTrue(packet.getMessage() instanceof Notify);
    do {
        packet = dec.decodePacket(conn, state, in);
    } while (packet == null);
    assertNotNull(packet);
    assertTrue(packet.getMessage() instanceof AudioData);
}
 
开发者ID:Red5,项目名称:red5-client,代码行数:26,代码来源:RTMPClientProtocolDecoderTest.java


示例5: testValidateFromYouTube

import org.red5.io.utils.IOUtils; //导入依赖的package包/类
@Test
public void testValidateFromYouTube() {
    log.info("\ntestValidateFromYouTube");
    // client side handshake handler
    OutboundHandshake out = new OutboundHandshake();
    // server response
    IoBuffer y = IoBuffer.allocate(0);
    y.setAutoExpand(true);
    y.put(IOUtils.hexStringToByteArray(youtubeS1));
    y.flip();
    log.debug("Validate youtube: {}", y);
    @SuppressWarnings("unused")
    boolean youtube = out.validate(y.array());
    //boolean decoded = out.decodeServerResponse1(y);
    
    //Assert.assertTrue(youtube && decoded);
}
 
开发者ID:Red5,项目名称:red5-client,代码行数:18,代码来源:RTMPHandshakeTest.java


示例6: testDecodeBufferChunks

import org.red5.io.utils.IOUtils; //导入依赖的package包/类
@Test
public void testDecodeBufferChunks() {
    log.debug("\n testDecodeBufferChunks");
    RTMPProtocolDecoder dec = new RTMPProtocolDecoder();
    List<Object> objs;
    RTMPConnection conn = new RTMPMinaConnection();
    conn.getState().setState(RTMP.STATE_CONNECTED);
    conn.setHandler(this);
    IoBuffer p00 = IoBuffer.wrap(IOUtils.hexStringToByteArray("030000000001531400000000020007636f6e6e656374003ff0000000000000030003617070020000000e6f626a656374456e636f64696e6700000000000000000000046670616401000008666c61736856657202001057494e2031312c322c3230322c3233350005746355726c02001b72746d703a2f2f36372e3136372e3136382e3138323a313933352f00c30b617564696f436f646563730040abee000000000000077061676555726c05000b636c7573746572506173730200086368616e67656d65000f70726976617465496e7374616e6365010000087075626c6963497002000d35342e3230392e32342e323138000a7075626c6963506f727400409e3c0000000000000d766964656fc346756e6374696f6e003ff0000000000000000470617468020000000c6361706162696c697469657300402e000000000000000673776655726c05000b766964656f436f64656373000000000000000000000009"));
    objs = dec.decodeBuffer(conn, p00);
    log.debug("Objects #00: {}", objs);
    assertNotNull("Objects should not be null", objs);
    assertFalse("Objects should not be empty", objs.isEmpty());
    assertEquals("Method should be 'connect'", "connect", ((Invoke) ((Packet) objs.get(0)).getMessage()).getCall().getServiceMethodName());
}
 
开发者ID:Red5,项目名称:red5-server-common,代码行数:16,代码来源:TestRTMPProtocolDecoder.java


示例7: fillBufferFromStringData

import org.red5.io.utils.IOUtils; //导入依赖的package包/类
@SuppressWarnings("unused")
private void fillBufferFromStringData(IoBuffer buf, String byteDumpFile) throws Exception {
    File f = new File(String.format("%s/target/test-classes/%s", System.getProperty("user.dir"), byteDumpFile));
    BufferedReader in = new BufferedReader(new FileReader(f));
    try {
        String line = null;
        while ((line = in.readLine()) != null) {
            buf.put(IOUtils.hexStringToByteArray(line));
        }
        buf.flip();
        log.debug("Filled buffer: {}", buf);
    } finally {
        in.close();
    }
}
 
开发者ID:Red5,项目名称:red5-server-common,代码行数:16,代码来源:TestRTMPProtocolDecoder.java


示例8: readTagHeader

import org.red5.io.utils.IOUtils; //导入依赖的package包/类
/**
 * Read only header part of a tag.
 *
 * @return Tag header
 * @throws UnsupportedDataTypeException
 */
private ITag readTagHeader() throws UnsupportedDataTypeException {
    // previous tag size (4 bytes) + flv tag header size (11 bytes)
    fillBuffer(15);
    // previous tag's size
    int previousTagSize = in.getInt();
    // start of the flv tag
    byte dataType = in.get();
    if (log.isTraceEnabled()) {
        log.trace("Bits: {}", Integer.toBinaryString(dataType));
    }
    dataType = (byte) (dataType & 31);
    byte filter = (byte) ((dataType & 63) >> 5);
    byte reserved = (byte) ((dataType & 127) >> 6);
    log.debug("Reserved: {}, Filter: {}, Datatype: {}", reserved, filter, dataType);
    switch (dataType) {
        case 8: // audio
            log.debug("Found audio");
            break;
        case 9: // video
            log.debug("Found video");
            break;
        case 15: // special fms undocumented type?
        case 18: // meta / script data
            log.debug("Found meta/script data");
            break;
        default:
            log.debug("Invalid data type detected ({}), reading ahead\n current position: {} limit: {}", dataType, in.position(), in.limit());
            throw new UnsupportedDataTypeException("Invalid data type detected (" + dataType + ")");
    }
    int bodySize = IOUtils.readUnsignedMediumInt(in);
    int timestamp = IOUtils.readExtendedMediumInt(in);
    int streamId = IOUtils.readUnsignedMediumInt(in);
    if (log.isDebugEnabled()) {
        log.debug("Data type: {} timestamp: {} stream id: {} body size: {} previous tag size: {}", new Object[] { dataType, timestamp, streamId, bodySize, previousTagSize });
    }
    return new Tag(dataType, timestamp, bodySize, null, previousTagSize);
}
 
开发者ID:Red5,项目名称:red5-io,代码行数:44,代码来源:FLVReader.java


示例9: testAMF0Connect

import org.red5.io.utils.IOUtils; //导入依赖的package包/类
@Test
public void testAMF0Connect() {
    log.debug("\ntestAMF0Connect");
    IoBuffer data = IoBuffer
            .wrap(IOUtils
                    .hexStringToByteArray("020007636f6e6e656374003ff00000000000000300036170700200086f666c6144656d6f0008666c61736856657202000e4c4e582032302c302c302c323836000673776655726c020029687474703a2f2f6c6f63616c686f73743a353038302f64656d6f732f6f666c615f64656d6f2e7377660005746355726c02001972746d703a2f2f6c6f63616c686f73742f6f666c6144656d6f0004667061640100000c6361706162696c697469657300406de00000000000000b617564696f436f646563730040abee0000000000000b766964656f436f6465637300406f800000000000000d766964656f46756e6374696f6e003ff000000000000000077061676555726c02002a687474703a2f2f6c6f63616c686f73743a353038302f64656d6f732f6f666c615f64656d6f2e68746d6c000009"));
    Input in0 = new Input(data);
    // action string
    Assert.assertEquals(DataTypes.CORE_STRING, in0.readDataType());
    String action = in0.readString();
    Assert.assertEquals("connect", action);
    // invoke trasaction id
    log.trace("Before reading number type: {}", data.position());
    byte type = in0.readDataType();
    log.trace("After reading number type({}): {}", type, data.position());
    Assert.assertEquals(DataTypes.CORE_NUMBER, type);
    Number transactionId = in0.readNumber();
    System.out.printf("Number - i: %d d: %f%n", transactionId.intValue(), transactionId.doubleValue());
    Map<String, Object> obj1 = Deserializer.deserialize(in0, Map.class);
    assertNotNull("Connection parameters should be valid", obj1);
    log.debug("Parameters: {}", obj1.toString());
    assertEquals("Application does not match", "oflaDemo", obj1.get("app"));
}
 
开发者ID:Red5,项目名称:red5-io,代码行数:24,代码来源:AMFIOTest.java


示例10: testOnStreamSendMap

import org.red5.io.utils.IOUtils; //导入依赖的package包/类
@Test
public void testOnStreamSendMap() {
    // 02 = string
    // 08 = mixed array (map) max number = 0
    
    IoBuffer data = IoBuffer.wrap(IOUtils.hexStringToByteArray("02 00 0c 6f 6e 53 74 72 65 61 6d 53 65 6e 64 08 00000000 00 05 76 616c7565 02 00 01 31 00 00 09"));
    Input in0 = new Input(data);
    assertEquals(DataTypes.CORE_STRING, in0.readDataType());
    String method = in0.readString();
    assertEquals("onStreamSend", method);
    assertEquals(DataTypes.CORE_MAP, in0.readDataType());
    @SuppressWarnings("rawtypes")
    ObjectMap map = (ObjectMap) in0.readMap();
    assertEquals(map.get("value"), "1");
}
 
开发者ID:Red5,项目名称:red5-io,代码行数:16,代码来源:InputTest.java


示例11: testInboundHandshake

import org.red5.io.utils.IOUtils; //导入依赖的package包/类
/** Serverside test */
@Test
public void testInboundHandshake() {
    log.info("\n testInboundHandshake");
    IoBuffer r5c1 = IoBuffer.allocate(1536);
    r5c1.put(IOUtils.hexStringToByteArray(red5clientC1));
    r5c1.flip();
    InboundHandshake in = new InboundHandshake();
    // try old method
    IoBuffer S1 = in.doHandshake(r5c1);
    log.debug("S1: {}", Hex.encodeHexString(S1.array()));
    Assert.assertNotNull(S1);
}
 
开发者ID:Red5,项目名称:red5-server,代码行数:14,代码来源:ServerRTMPHandshakeTest.java


示例12: testValidateFromFFMpeg

import org.red5.io.utils.IOUtils; //导入依赖的package包/类
@Test
public void testValidateFromFFMpeg() {
    log.info("\n testValidateFromFFMpeg");
    // server side handshake handler
    InboundHandshake in = new InboundHandshake((byte) 0x03);
    // set whether or not unverified will be allowed
    in.setUnvalidatedConnectionAllowed(true);
    // FFMPEG
    IoBuffer cc = IoBuffer.allocate(1536);
    // C1
    //cc.put(IOUtils.hexStringToByteArray(ffmpegC1));
    cc.put(IOUtils.hexStringToByteArray(ffmpeg3C1));
    cc.flip();
    log.debug("FFMpeg c1: {}", cc);
    // use pregenerated server handshake bytes
    IoBuffer svr = IoBuffer.wrap(IOUtils.hexStringToByteArray(ffmpeg3ServerHS));
    in.setHandshakeBytes(svr.array());
    // decode C1
    IoBuffer s0s1s2 = in.decodeClientRequest1(cc);
    log.debug("Server reponse: {}", s0s1s2);
    // C2
    IoBuffer c2 = IoBuffer.wrap(IOUtils.hexStringToByteArray(ffmpeg3C2));
    // decode C2
    boolean ffmpeg = in.decodeClientRequest2(c2);
    // prevent travis CI from failing; we know this is broken atm
    if (!ffmpeg) {
        log.warn("FFMpeg validation failed");
    }
    //Assert.assertTrue(ffmpeg);
}
 
开发者ID:Red5,项目名称:red5-server,代码行数:31,代码来源:ServerRTMPHandshakeTest.java


示例13: testOutgoingPublicKey

import org.red5.io.utils.IOUtils; //导入依赖的package包/类
@Test
public void testOutgoingPublicKey() {
    log.info("\n testOutgoingPublicKey");
    byte[] sharedSecret = IOUtils.hexStringToByteArray("04cde275ff2d72113cfac0e914bf4dab3bc747dfb63c23314b470181e7260a1f37ae3ef259f3bd3fe80ec5ebf99d501e4cce69d224268e6d5304cbfb94bc71d59f15564f96a089f9a93b5e08d9ea0c45ca5934ff2c9729cc73856fd130cb6bfe29f14a0ec36e0eee0cd5c21c1d08f6f9979adc162d24831318a3b9145d835222");
    byte[] outgoingPublicKey = IOUtils.hexStringToByteArray("d5055cd576014c41fc91811a7f6aaaacc8f5bef9383cabb3c91afd392448255ef14a38e8c985197652a47a31e2852d7923dae7c2c10df3b325556c4f2fbc14b04e244570c42526e67d2c5c3e75fcd1732c7b915839653274df15d887c10852dae81d54e52fe26946fd7936fc69926e7a33c9e3aba7ae2a93cbbd4c481cde3f90");
    InboundHandshake in = new InboundHandshake();
    byte[] rc4keyOut = new byte[32];
    in.calculateHMAC_SHA256(outgoingPublicKey, 0, outgoingPublicKey.length, sharedSecret, RTMPHandshake.KEY_LENGTH, rc4keyOut, 0);
    log.debug("rc4keyOut: {}", rc4keyOut);
    Assert.assertNotEquals(IOUtils.hexStringToByteArray("0000000000000000000000000000000000000000000000000000000000000000"), rc4keyOut);
}
 
开发者ID:Red5,项目名称:red5-server,代码行数:12,代码来源:ServerRTMPHandshakeTest.java


示例14: testDumpedData

import org.red5.io.utils.IOUtils; //导入依赖的package包/类
@SuppressWarnings("unused")
@Test
public void testDumpedData() throws InterruptedException {
    log.info("\n testDumpedData");
    // client side
    byte[] clientSwfHash = IOUtils.hexStringToByteArray("f4d190ed4afa3bdbb001ded30f4ab005f4c30c79730373510694f6f0ed86b59f");
    int clientSwfSize = 90559;
    byte[] initialClientDigest = IOUtils.hexStringToByteArray("ed cf cf d3 70 7a 19 99 84 e7 21 2b 81 0c 92 c115 4d 63 51 0c 46 a6 72 2b a6 4f 9a 5d d6 6c 5b");
    byte[] calculatedDigestKeyFromSecureKeyAndServerDigest = IOUtils.hexStringToByteArray("01 6c 9f a8 6c 82 02 d8 ba fb 18 14 74 0c fd c8ed ff 9c 19 44 a5 ad e8 65 64 69 f7 54 a1 4d 97");
    byte[] clientSignatureCalculated = IOUtils.hexStringToByteArray("b0 b0 f3 97 ef 99 7c 74 2e bd cb 86 2f 12 79 7358 3e 9d c9 62 7f c9 82 5d df 7a 52 58 23 a8 4d");
    byte[] serverSentSignature = IOUtils.hexStringToByteArray("93 5b f5 23 cc 7d 23 26 7f 6a d3 d1 df d5 cd a1eb 7a 09 12 ba b6 cd 8e cb 57 01 53 2d 00 31 0b");
    byte[] digestKey = IOUtils.hexStringToByteArray("08 ac e1 4e 20 b1 6f 31 4a 93 b7 5f 1b b6 42 ef9b 2d e6 c9 b3 c5 35 ed 09 72 d9 90 31 60 3e b6");
    byte[] signatureCalculated = IOUtils.hexStringToByteArray("93 5b f5 23 cc 7d 23 26 7f 6a d3 d1 df d5 cd a1eb 7a 09 12 ba b6 cd 8e cb 57 01 53 2d 00 31 0b");
    // server side
    byte[] clientRequest1 = IOUtils
            .hexStringToByteArray("25f1a5080a002d0267458b6bc6237b3269983c647348336651dcb074ff5c49194a94e82aec585562291f8e23cd7ce846ba581b3dabd77e50f241b12efb1eb741e3a9e27946e145757c005f51c262d05b54082012f827b14d1b231602e8e9161fe7cd90118d43ef66760f0e145a2552332ef99c106372ed0d33c2dc7f9fd7ef1bc9c4a7419a07686b66fb6a4e325de4250d509b51b7d71b4331ba2d3f58e4837ca33071255ad9bb6225616c435d898c6205b13a3317a31d7258a84324e95a1d2d5e846367d4a8a275abbded08b28c8379cdd05343c6e0030b9b769a18b49ee4545424f3711186a82c0ec43608821d900274f8953a4186130821f57f1e3dbd3d7cdc8d7b7387f0ea6c701a2222e9dd16453ec80630a1d44f6141c29a41e1f87755fcad0b44672307053e820438015f46777ec62477972a485ceab96324dc4a885e6bd3ea519677512d8fd70b5838a43e155c5855382a4ea670ec42236ab07c482a3bd44e1dfb065a72329ad82cafcce4573c8d6d7a548f584bec892254181be96ddb7f43385ca4447602f9ff321a484a68fe78945743bb9a74fb40c23dfa26a01baadea1793ac3c675fb85e61229a5edcfcfd3707a199984e7212b810c92c1154d63510c46a6722ba64f9a5dd66c5bf11cbe15011861a85b23898c3947f9e94f355cafb515bb261274a8b6340d993c23100fb66a3f95405761b1570c7eeb35ae77f1e49b57b3500c31057ef85fef5d302ff70ba72500bfba1de984d04aa1ea481f3a828113e50ab75dca8f0f100b709065cb4a0115d07f5e5f48318a0947029d796447b906bd96c2421f128e16235dba1e1e3f1e66a89ec75d1c470a547beed37b64c5d951c5fd3e61142bf70b737b44115a3e9642c582030a5eb1f2084b23321a79d30f3b632feb683b81624970dfb66064eea5062406331411caff7f9e70271a0911ea71dc590f10aae0b77fd45beb06acd96d6ff21142091b5e880010212776afa8044c3b701617337ee114cde72232e30ede7450c5eb6848d6f62d47d4b74615c32a4a5c01ee39bb4ffc576f01c10c2284f1431901ef60ba24f3269b57017f7d30da49f5a555700b37b85fe11e80501aac88041c01b85f7f8fa76a23bd7276f85ac76f29705f6af8185e7da434355f1b82a1731377e67db5555c55ca2aa63f4ee7fc14e8d33d6a9812c97132f6da0938992953e0e8bf1f79ca92504d5c541d3deaad59341a8f28bc5d152a5f6e9f1d4e1b7e0977820851fac5a01ccb4b58536c285e4105fd587cac6ad82386d4e64521fe105c2bfa7f0eaa91593c1a59d84b556adf78a2aab739be8d0d2b70ec806cb5219e3773e369003b17272c04099b4c5cb7a76ad329f01d36ff75569450d13db312b03dafc90827e2ac255bf0fc5d17e4e3974f9e0a3b054f6bfd3432ff1559158d435649319e51fd4a6e2c82b5a1174e2ef74da9b54650088a885d702c082ad4afc65eb21be2198a85e075291aa65754c699534813ee209a0627440ae8370bbcf65721d51d4e700ef1d25718aeff0ba8473e0e44f0482eacfed0495b5aee4bf3b951558eabf6244c574c63d79de9242db6312a9bc24918099dff7d42437500e5f3e76906e86d2ac4f816183322df37af9db47acd829f75a34ee761844d7b597f9e810f2dd4c757ad672131d4641b6376e7b578476e4875de4c536e32de0d1a1c8c9665ec3d26464a8c0d26c4d3d473302e6f74f68ade6f202ec33f23e8c0498536d5146c850f23fb85aa6eb2ec063f0748593b0423aa6cf42f7c3fec3b41250b0b1817b9289357205e205dbaa8cc1186ab324dc3ac073f3ef6476b054ab45cf180cf16ec5d691cd9aecf3f6768850f33ccb111b7fb222e9946932950584877a3394974e3d2a04f142c1d6bd367b868d95d7f3f345ae02af74f79325e945454a0dfef4df2d5232110815b13a8274909f6f8cd0d05b1d75294638a2e0104e624bed96a2ab4c1aa0bbcacb23644859d77786eb24afaa2fa2149cf515469ef8161e600643e237e2114d05707711acd1550da794442699e9a1a6a255e477eb38d364c713b6a7e517b32511b461f25cfba29b3ab5b5d486bbf5184630f7e538b4b2b3a41e37294e46a11fbb29434313ab1009995426490161f63323e9725576fad0e44d8c96eeeea495c9bf44a06bc467c39");
    // prior to any manipulation minus the last 32 bytes
    byte[] serverInitialHandshake = IOUtils
            .hexStringToByteArray("00000010040000013bb703ae42f0a30b53ab81fa65005d707b7740b0dbe119d134c64b0a4b7a84c9709ecc315dabc88affb144efdf4ece9369fa0dfc97ebc65bdd984ef65a3e292e10e29a9b2032e3114b2d1f602e931590f0f577a78afc7bd44131a3645a04a0f337f6b105d8d2bd9897cbf051ffe8772bbcb098692c3742b6a44f3fb13391fc40424bac58c45c819f285ba13a15d886b7fe6d9eec27da33326b6ea8342143f1b85612ddce9acae01ba562e765c542b2fcebf93415d912a8f1a062bb5d346801c4d911768303bd1f4f9c4919d679a4b9333d46e493d59f1642728c97b3cee43765f789e39b1ac57d97fb10cb812da0960bb016f6836243dd1bb1978faa272a9ca71e291036f27ed056979b3a65f5deba3386bdb4fbfa0551b056cc41f1cc7cdf7f8210832a0d7c56b7a886ccfc753ebb4304e8145acd48c58ef9ee399d1c8bfc329ae889dde5fd0c6f4b921b64674fc222f37a1cce3ca872fb59b1be68ca53c3efa105e1ce668012a1ff995c83192464421f7f980c5eae67c6d8b2ac055e5c8b4e169c8b537214e0a3281d196bec6ead19db1df4687e55edcbfc108163b43786d73c05cee95c8a63c29057823cd6f0874e7cad428e9a5a094bf087f5a87b5c6c859b137ce36d6c4405e1e9dec2e137cee4d9cdcee5e65f086a0023d08bb64b7e777d770db763c9ddb02c12d530aaada89bd294c05047df3994217dc8a33f0714ab72332a24edceb66b6574934ae3f50d5bc6caac3ad9ec47d76691a44f3fd834a2cc20a17c303484f0e4721aa4d19c80341b371f336ac9d4098c1befc5b865f1512484face4574fcc5e5162881ce156403b9fc712cfc4448506f88e9f4fb1a7a90d3b11864b8d808b609898852c809832a8f06843647f1f68793769be732de2b807ac298fd0b541da5d319cdc2c0f5a0450d84200c34240d3c9cc62180d7160d227a57e586312cc1f92cdaabc24d1931e7a975291263cae70ad63b9f793b04754f7d6f2d77137592fbe0c3890b16b58ca35a49d777a609c5cdaeac70ce0064d7d7eb4ab1f60e5b4e701f72f11c5b9942bc20879fff84b3f66736c386d19f68ee64766017f6733da844fc69f8cf6d045ab77a8d9498b78700dea54d0784e4ffbc148f61bbca0699f93df1f2d43932d1a20fee5d5058ae464c38d51e98f26d69236eee4e298f80c214895a7f26bda2f56cf48579bc950c945dc0c47ef5af2e1d00720e9d367b0e71c479f5a4b2d74c5141c04bcd48dd27a9af5a132bb6d4ef011710ae686ba3cf18c2f568a59870d2cb7567d3ae633789d7a61a8ae75e46ccf3383451bbad1359152dd5bb863d2968c3b6a0b2e844c273db3fb1929e276ab49a65f5bfdf600534a4ccf9dabb727959cbdff200d75df055fe6602b91114d2ec90e12d82c66a055dafa6fd145d992d82babd24da9300d557092100321a42e589d97ae86a7ad13ac567b5209ff0c333d50994c4e23310c9d407f0e552798ffef9a6759c09a5e2a2d0afc58c11c31883d8827f9ebd12cc59d9d91d121439f9fe7b71db2638231704d755c81de8cff64e233e1002942f08e4ab96d605969c56dba25d26cd90a9248da61e209c043a9fa5e6f1b4a8949964763ebf3c889aa0513fd6f2825af278ef91fe9fb6bd285465106090d1e76eec5595be40e183060cbff9d221229600234e9c14ebe1517c39a7c969369b9ad7dc10440a4749f96410b888279b55e6a15ed112100765b30ef610a3e96913d909d5aa4534df6b4c637a17c6b87570f181ec010c903b15fb4c3fecc45ea8bc2241a101e2026a514654723c673c25a6728e8bc680222bee748bbc7e055b45e21c3f2c3c9a70de3e5fadcc34bdc0c061467cfde3f4cdbd9e8884dfb8b503998d65c94bf6202cdc16498aeab0e42299cfe6421bc9d889dbd89dd14cb766927e8245289d699a198eda3c272a635f971f932e9bf9185cc2f6ed8374d4d859d522dd3ca87125a1cd5c744167e7ace2251ce33c861da524d966828b51fa6a03ac222b7f1dcb27cc1271367d500cbb012a3486c3c7c0c961a39261d0b00e2f468ff919755968697b6806b7a68d31743bd3c069dc64265e00e8eabc28bcd639d406c01443b7e12e80828df4d4eb4edadea6f5ccc128ffaa57e5b45fce06c5ef6f303a6b2593d5b0cec59eeb41");
    byte[] initialServerDigest = IOUtils.hexStringToByteArray("5dbcf41ee9847bc4c27f8a6008e3b4f5aa2daad89c982ceeac5f7ec1d768a8ba");
    byte[] calculatedClientDigest = IOUtils.hexStringToByteArray("edcfcfd3707a199984e7212b810c92c1154d63510c46a6722ba64f9a5dd66c5b");
    Assert.assertArrayEquals(initialClientDigest, calculatedClientDigest);
    byte[] calculatedDigestKey = IOUtils.hexStringToByteArray("08ace14e20b16f314a93b75f1bb642ef9b2de6c9b3c535ed0972d99031603eb6");
    Assert.assertArrayEquals(digestKey, calculatedDigestKey);
    byte[] signatureResponse = IOUtils.hexStringToByteArray("935bf523cc7d23267f6ad3d1dfd5cda1eb7a0912bab6cd8ecb5701532d00310b");
    Assert.assertArrayEquals(serverSentSignature, signatureResponse);

    byte[] s0s1s2 = IOUtils
            .hexStringToByteArray("0300000010040000013bb703ae42f0a30b53ab81fa65005d707b7740b0dbe119d134c64b0a4b7a84c9709ecc315dabc88affb144efdf4ece9369fa0dfc97ebc65bdd984ef65a3e292e10e29a9b2032e3114b2d1f602e931590f0f577a78afc7bd44131a3645a04a0f337f6b105d8d2bd9897cbf051ffe8772bbcb098692c3742b6a44f3fb13391fc40424bac58c45c819f285ba13a15d886b7fe6d9eec27da33326b6ea8342143f1b85612ddce9acae01ba562e765c542b2fcebf93415d912a8f1a062bb5d346801c4d911768303bd1f4f9c4919d679a4b9333d46e493d59f1642728c97b3cee43765f789e39b1ac57d97fb10cb812da0960bb016f6836243dd1bb1978faa272a9ca71e291036f27ed056979b3a65f5deba3386bdb4fbfa0551b056cc41f1cc7cdf7f8210832a0d7c56b7a886ccfc753ebb4304e8145acd48c58ef9ee399d1c8bfc329ae889dde5fd0c6f4b921b64674fc222f37a1cce3ca872fb59b1be68ca53c3efa105e1ce668012a1ff995c83192464421f7f980c5eae67c6d8b2ac055e5c8b4e169c8b537214e0a3281d196bec6ead19db1df4687e55edcbfc108163b43786d73c05cee95c8a63c29057823cd6f0874e7cad428e9a5a094bf087f5a87b5c6c859b137ce36d6c4405e1e9dec2e137cee4d9cdcee5e65f086a0023d08bb64b7e777d770db763c9ddb02c12d530aaada89bd294c05047df3994217dc8a33f0714ab72332a24edceb66b6574934ae3f50d5bc6caac3ad9ec47d76691a44f3fd834a2cc20a17c303484f0e4721aa4d19c80341b371f336ac9d4098c1befc5b865f1512484face4574fcc5e5162881ce156403b9fc712cfc4448506f88e9f4fb1a7a90d3b11864b8d808b609898852c809832a8f06843647f1f68793769be732de2b807ac298fd0b541da5d319cdc2c0f5a0450d84200c34240d3c9cc62180d7160d227a57e586312cc1f92cdaabc24d1931e7a975291263cae70ad63b9f793b04754f7d6f2d77137592fbe0c3890b16b58ca35a49d777a609c5cdaeac70ce0064d7d7eb4ab1f60e5b4e701f72f11c5b9942bc20879fff84b3f66736c386d19f68ee64766017f6733da844fc69f8cf6d045ab77a8d9498b78700dea54d0784e4ffbc148f61bbca0699f93df1f2d43932d1a20fee5d5058ae464c38d51e98f26d69236eee4e298f80c214895a7f26bda2f56cf48579bc950c945dc0c47ef5af2e1d00720e9d367b0e71c479f5a4b2d74c5141c04bcd48dd27a9af5a132bb6d4ef011710ae686ba3cf18c2f568a59870d2cb7567d3ae633789d7a61a8ae75e46ccf3383451bbad1359152dd5bb863d2968c3b6a0b2e844c273db3fb1929e276ab49a65f5bfdf600534a4ccf9dabb727959cbdff200d75df055fe6602b91114d2ec90e12d82c66a055dafa6fd145d992d82babd24da9300d557092100321a42e589d97ae86a7ad13ac567b5209ff0c333d50994c4e23310c9d407f0e552798ffef9a6759c09a5e2a2d0afc58c11c31883d8827f9ebd12cc59d9d91d121439f9fe7b71db2638231704d755c81de8cff64e233e1002942f08e4ab96d605969c56dba25d26cd90a9248da61e209c043a9fa5e6f1b4a8949964763ebf3c889aa0513fd6f2825af278ef91fe9fb6bd285465106090d1e76eec5595be40e183060cbff9d221229600234e9c14ebe1517c39a7c969369b9ad7dc10440a4749f96410b888279b55e6a15ed112100765b30ef610a3e96913d909d5aa4534df6b4c637a17c6b87570f181ec010c903b15fb4c3fecc45ea8bc2241a101e2026a514654723c673c25a6728e8bc680222bee748bbc7e055b45e21c3f2c3c9a70de3e5fadcc34bdc0c061467cfde3f4cdbd9e8884dfb8b503998d65c94bf6202cdc16498aeab0e42299cfe6421bc9d889dbd89dd14cb766927e8245289d699a198eda3c275dbcf41ee9847bc4c27f8a6008e3b4f5aa2daad89c982ceeac5f7ec1d768a8bae7ace2251ce33c861da524d966828b51fa6a03ac222b7f1dcb27cc1271367d500cbb012a3486c3c7c0c961a39261d0b00e2f468ff919755968697b6806b7a68d31743bd3c069dc64265e00e8eabc28bcd639d406c01443b7e12e80828df4d4eb4edadea6f5ccc128ffaa57e5b45fce06c5ef6f303a6b2593d5b0cec59eeb4125f1a5080a002d0267458b6bc6237b3269983c647348336651dcb074ff5c49194a94e82aec585562291f8e23cd7ce846ba581b3dabd77e50f241b12efb1eb741e3a9e27946e145757c005f51c262d05b54082012f827b14d1b231602e8e9161fe7cd90118d43ef66760f0e145a2552332ef99c106372ed0d33c2dc7f9fd7ef1bc9c4a7419a07686b66fb6a4e325de4250d509b51b7d71b4331ba2d3f58e4837ca33071255ad9bb6225616c435d898c6205b13a3317a31d7258a84324e95a1d2d5e846367d4a8a275abbded08b28c8379cdd05343c6e0030b9b769a18b49ee4545424f3711186a82c0ec43608821d900274f8953a4186130821f57f1e3dbd3d7cdc8d7b7387f0ea6c701a2222e9dd16453ec80630a1d44f6141c29a41e1f87755fcad0b44672307053e820438015f46777ec62477972a485ceab96324dc4a885e6bd3ea519677512d8fd70b5838a43e155c5855382a4ea670ec42236ab07c482a3bd44e1dfb065a72329ad82cafcce4573c8d6d7a548f584bec892254181be96ddb7f43385ca4447602f9ff321a484a68fe78945743bb9a74fb40c23dfa26a01baadea1793ac3c675fb85e61229a5edcfcfd3707a199984e7212b810c92c1154d63510c46a6722ba64f9a5dd66c5bf11cbe15011861a85b23898c3947f9e94f355cafb515bb261274a8b6340d993c23100fb66a3f95405761b1570c7eeb35ae77f1e49b57b3500c31057ef85fef5d302ff70ba72500bfba1de984d04aa1ea481f3a828113e50ab75dca8f0f100b709065cb4a0115d07f5e5f48318a0947029d796447b906bd96c2421f128e16235dba1e1e3f1e66a89ec75d1c470a547beed37b64c5d951c5fd3e61142bf70b737b44115a3e9642c582030a5eb1f2084b23321a79d30f3b632feb683b81624970dfb66064eea5062406331411caff7f9e70271a0911ea71dc590f10aae0b77fd45beb06acd96d6ff21142091b5e880010212776afa8044c3b701617337ee114cde72232e30ede7450c5eb6848d6f62d47d4b74615c32a4a5c01ee39bb4ffc576f01c10c2284f1431901ef60ba24f3269b57017f7d30da49f5a555700b37b85fe11e80501aac88041c01b85f7f8fa76a23bd7276f85ac76f29705f6af8185e7da434355f1b82a1731377e67db5555c55ca2aa63f4ee7fc14e8d33d6a9812c97132f6da0938992953e0e8bf1f79ca92504d5c541d3deaad59341a8f28bc5d152a5f6e9f1d4e1b7e0977820851fac5a01ccb4b58536c285e4105fd587cac6ad82386d4e64521fe105c2bfa7f0eaa91593c1a59d84b556adf78a2aab739be8d0d2b70ec806cb5219e3773e369003b17272c04099b4c5cb7a76ad329f01d36ff75569450d13db312b03dafc90827e2ac255bf0fc5d17e4e3974f9e0a3b054f6bfd3432ff1559158d435649319e51fd4a6e2c82b5a1174e2ef74da9b54650088a885d702c082ad4afc65eb21be2198a85e075291aa65754c699534813ee209a0627440ae8370bbcf65721d51d4e700ef1d25718aeff0ba8473e0e44f0482eacfed0495b5aee4bf3b951558eabf6244c574c63d79de9242db6312a9bc24918099dff7d42437500e5f3e76906e86d2ac4f816183322df37af9db47acd829f75a34ee761844d7b597f9e810f2dd4c757ad672131d4641b6376e7b578476e4875de4c536e32de0d1a1c8c9665ec3d26464a8c0d26c4d3d473302e6f74f68ade6f202ec33f23e8c0498536d5146c850f23fb85aa6eb2ec063f0748593b0423aa6cf42f7c3fec3b41250b0b1817b9289357205e205dbaa8cc1186ab324dc3ac073f3ef6476b054ab45cf180cf16ec5d691cd9aecf3f6768850f33ccb111b7fb222e9946932950584877a3394974e3d2a04f142c1d6bd367b868d95d7f3f345ae02af74f79325e945454a0dfef4df2d5232110815b13a8274909f6f8cd0d05b1d75294638a2e0104e624bed96a2ab4c1aa0bbcacb23644859d77786eb24afaa2fa2149cf515469ef8161e600643e237e2114d05707711acd1550da794442699e9a1a6a255e477eb38d364c713b6a7e517b32511b461f25cfba29b3ab5b5d486bbf5184630f7e538b4b2b3a41e37294e46a11fbb29434313ab100935bf523cc7d23267f6ad3d1dfd5cda1eb7a0912bab6cd8ecb5701532d00310b");
    byte[] c2 = IOUtils
            .hexStringToByteArray("e98d447ee5c39c5a2536fe1acf8ea83c0842be6ef58d050ce95bbe0ce2bb02315e2ca02653811c54606f9067aa9ddb10d2d29706b28ad606d06c963a857ef363faf5955854d0a538d8093f0f3537794be8b4104ad4bcd34366712a4c824a532e64d3f22698afc171d9b9003da8abbc15879a0b4e75ae4b4365f2384f7028504c5a72e81d8a28376a3fb7f80862b4a60c80b63c762913b7154470a93ddee2dc1c7c94d369a5df39258980b82d4e676b70576a102c59ed4e68d3e55e545160a604adbdf420acef9d6386971f509572056b80ac7127ec084a1c17bd5819e47f644e85b80b0ef17659568c2b21640c53175c6625a519f11d5a337c7b6728c0978d377c46911dbb326031224c3444fcfccd13e445174766bcdd01dadfaa3061daea300b9c17276360635eaf41562162062853bc4db2468327b575b466ce57690ba7672f1753593afeed27ff7dac52afc3c40027073844163b056c9343294facbf435207b25e421f6f4a33b8125b2e6dd7035c118da466348ec2562d6f91138dd33504efc022084fbbc55789d00318d4063a4fb677a35963b0ae4835e12400c113bb00c7101227e4227b21241ae353835ec46d674a3017d880b12bed696b5596618370127f9f53ece71728452548713986d71702231d14d8687140e5451b6a0ad57b56f8d7bb739d58761877ac7f320965605ad1e6386fa51b11469638965ec1a75b77f4d6d61d1f099a7695ae9546aa4e7a7782b9483fca8fba466c62357849ca5a66aeb23568907c184ccd281f5416fd657f68fdc977ba928a29ac5ee96f7a7c694ba67aa251f2833161b4024163a89dbf65caeca22199485c4db2723b3cc2c45e1537a1d2652a1fbb6ecb29bf6f08880b55cf3acc346162554ec92f674cc311a352806bef445edefc126e601d4a03253804286eb759dac252424cef926ad720ed416a3f6b0e1918b23eed1d5341d23c3506d3aa3c68997c3c314cb99e517925df398b006e1200bcdf3422c39e1f56ed10349a043c02d435da5b18b26f49d1a50e68fe54954ae4db2e39d92d1a3dcd8f617f453e8407a35d810991a10452c6a9734c013c7e1cff01221cc9ceab502aaa3576d9c4745e15be3e3b01cb22384304e06c2fd6f079eee875791541157302812d628765b22a61fab3447ca60c1c1366203d62b693799e69ab3b69533171fcbacf7b729f85178105a13acd60de6371f41a6265e1cf73a68ef8203e847c61ab1f547b49ec792acf25813371c9c7474b28f846ce27a34f3a98731875d22d3da7ec172e4f56b253769d5075eaf0f71a7e2ca34d6486c66eff310d0e81add02febeb7819612cc152fd53dd4bfe519956c3e2544c9bbd880767a5ca47bf9d24480d5d0e1fe9aa6b028cfe022c7e5129014e8c3b76328dfb4cbdd5a562f9ab8f717c7975778cfb26166a755739c7a16d3e5b23ca65a40dcb513c749b7b0210e213f4637d25b211ec70ed00da2e729020731698b25fec32e73cf33df12201842b794d5fa80ff091ce6e00d6c44f1042fd5b8b4f5776677b8f17cfdf212499ac65155026fb195bde245017fe8e169fb236108e6b201dd4d33479985ec6010ae5951461cf5b0f03d41d3bd1860353bcf22575a7e1e80c0dfb9e4ebe0208099b456632bf0c8b3fab03e2370ed68625d5a43d1f9836c97401147848d6286918e5957104f2a54637d6fe2d68f6d76e607df59d2d3e7abd7fc5b7900416a203438ea0b8192196b5542ea092592d53ef29af01d6710274c752c6b1b52bb9e66b0663432362c985d3668a6d6f591f3649577067bc7397680e28de3851600cad222656759967893c33181a83a94b2b1ad7062173fc0c1b9721140143401f07096e110d3d684bd8416e07fde0dc718b32067916bc2b07c2986d76a1d4093ca45ce420e32e234bcf749c15d2afd34a9230f93cd2e86368986189764b176543352c874a61e75c5dd584d41c5562d021d14e19516cede244339b2102ddfb3b77c2627c2cbcd7541af77ee542ed7c5333de4a512713160757efbf9352e553bf3820536f22c701025ae2349c2aab85751bddbd2d61a4cd09214d5a7f57811a120288fc2c6c1ccf1b6d53cae54c1a2d2629eeb77f55eb2b6f4366448b6cb0b0f397ef997c742ebdcb862f127973583e9dc9627fc9825ddf7a525823a84d");

    InboundHandshake in = new InboundHandshake();
    in.setHandshakeBytes(serverInitialHandshake);
    IoBuffer serverResponse = in.decodeClientRequest1(IoBuffer.wrap(clientRequest1));
    Assert.assertArrayEquals(s0s1s2, serverResponse.array());
    Assert.assertTrue(in.decodeClientRequest2(IoBuffer.wrap(c2)));

}
 
开发者ID:Red5,项目名称:red5-server,代码行数:40,代码来源:ServerRTMPHandshakeTest.java


示例15: testDecodeBufferYugeTimestamp2

import org.red5.io.utils.IOUtils; //导入依赖的package包/类
@Test
public void testDecodeBufferYugeTimestamp2() {
    // this test data is from a flash forum
    byte[] buf = IOUtils.hexStringToByteArray("06FFFFFF00BC48090100000001643DD012 00 00 84 02 80 9E FE 25 2A 2E F8 30 3F 99 FC 4C AB 6E B7 2F CB CB E2 DE 62 A7 86 9E BC 3E 04 05 73 C3 D1 F0 FB 70 45 12 80 32 CE 4C B3 44 6E 76 37 66 62 C7 A5 84 A0 60 12 C1 80 51 55 E9 41 80 D5 06 01 69 55 53 EB 70 18 06 10 60 1A FC C2 BF 4C B0 03 65 1D E5 FA 6B 57 AE 91 80 C0 25 03 00 A9 E2 EB F0 60 36 01 80 61 B6 65 1D 83 00 D0 0C 03 82 B1 16 C0 52 89 35 7A D3 18 C2 88 F6 CD C601 64 3D D000 FE 03 02 F7 28 19 50 AF F8 55 7D 8C 35 1A 33 0E 3D EE DC F2 75 3B 10 E4 CC 21 7B CF C1 80 11 06 00 64 BF 41 0C 18 00 F0 0C F9 7F F2 DA AC 18 01 10 40 56 3B C5 17 3F 4B BE AD AC B6 E5 DC C1 DC 91 EF 60 C0 4F 03 00 3E 5F B6 83 00 36 0C 00 99 7C A0 C1 88 80 62 A5 3C C0 60 9E 81 80 10 CD 9B 59 83 BE B0 E8 F5 40 C0 22 03 00 A9 00 D8 30 0C 00 C0 36 97 F2 D0 60 5E 02 1D 08 39 F1 EE 03C6 01 64 3D D0 04 F2 07 FB 67 07 6D F6 5B B6 9F 8E A0 C0 20 83 00 B3 E5 14 18 0F 00 84 AF 6A AD A2 58 30 02 A0 C0 0C 04 39 F8 A6 A9 D0 60 3E 41 80 10 2F 6B 16 98 C0 8A E6 AF 2A 12 44 75 73 CA F6 62 90 3F FA 58 08 52 6C 63 AB 64 E1 D8 70 43 FC 9C 2F 2F F5 9B 66 5A 0A AD FB 48 0C 3D E8 18 0A 60 60 09 2D 55 FF 03 00 3A 0C 00 CA 8B C5 70 4B 06 00 60 18 00 F2 FA 8F EA 84 88 5D F9 19 6B E0 59 EF 5E 06");
    RTMPConnection conn = RTMPConnManager.getInstance().createConnection(RTMPMinaConnection.class);
    conn.setStateCode(RTMP.STATE_CONNECTED);
    
    RTMPClientProtocolDecoder decoder = new RTMPClientProtocolDecoder();
    decoder.decodeBuffer(conn, IoBuffer.wrap(buf));
}
 
开发者ID:Red5,项目名称:red5-client,代码行数:11,代码来源:RTMPClientProtocolDecoderTest.java


示例16: readTagHeader

import org.red5.io.utils.IOUtils; //导入依赖的package包/类
/**
 * Read only header part of a tag.
 *
 * @return              Tag header
 */
private ITag readTagHeader() {
	// previous tag size (4 bytes) + flv tag header size (11 bytes)
	fillBuffer(15);
	//		if (log.isDebugEnabled()) {
	//			in.mark();
	//			StringBuilder sb = new StringBuilder();
	//			HexDump.dumpHex(sb, in.array());
	//			log.debug("\n{}", sb);
	//			in.reset();
	//		}		
	// previous tag's size
	int previousTagSize = in.getInt();
	// start of the flv tag
	byte dataType = in.get();
	if (log.isTraceEnabled()) {
		log.trace("Bits: {}", Integer.toBinaryString(dataType));
	}
	dataType = (byte) (dataType & 31);
	byte filter = (byte) ((dataType & 63) >> 5);
	byte reserved = (byte) ((dataType & 127) >> 6);
	log.debug("Reserved: {}, Filter: {}, Datatype: {}", reserved, filter, dataType);
	switch (dataType) {
		case 8: // audio
			log.debug("Found audio");
			break;
		case 9: // video
			log.debug("Found video");
			break;
		case 15: // special fms undocumented type?
		case 18: // meta / script data
			log.debug("Found meta/script data");			
			break;
		default:
			log.debug("Invalid data type detected ({}), reading ahead", dataType);
			log.debug("Current position: {} limit: {}", in.position(), in.limit());
			// loop a few times to see if we find a usable data type
			int i = 0;
			while (dataType != 8 && dataType != 9 && dataType != 18) {
				// only allow 10 loops
				if (i++ > 10) {
					return null;
				}
				// move ahead and see if we get a valid datatype		
				dataType = in.get();
			}
	}
	//		byte aacType = 0;
	//		if (dataType == 8 && keyframeMeta.audioCodecId == AudioCodec.AAC.getId()) {
	//			// flv spec ind 

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java Workspace类代码示例发布时间:2022-05-22
下一篇:
Java StopServerResponse类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap