Package java.io

Examples of java.io.DataOutputStream.writeByte()


        o1.writeLong(2L);
        o2.writeByteAndLong((byte)9, 2L);
        o1.writeByte((byte)9);
        o1.writeFloat(1.1f);
        o2.writeByteAndFloat((byte)9, 1.1f);
        o1.writeByte((byte)9);
        o1.writeDouble(1.1);
        o2.writeByteAndDouble((byte)9, 1.1);
        byte[] b1 = bo.toByteArray();
        byte[] b2 = o2.toByteArray();
        assertEquals(b1.length, b2.length);
View Full Code Here


                    packetSize += RTCPSenderInfo.SIZE;
                }

                // Add a RTCP header
                output.writeByte(0x80 | 0 | (rc & 0x1F));
                output.writeByte(packetType & 0xFF);
                output.writeShort(((packetSize) / 4) - 1);

                // If we are a sender, add sender stats
                if (we_sent)
                {
View Full Code Here

                        {
                            DLSR = ((now - stream.getLastSRReportTime()) * 65536) / 1000;
                        }

                        output.writeInt((int) (stream.getSSRC() & 0xFFFFFFFF));
                        output.writeByte((int)(lossFraction & 0xFF));
                        output.writeByte((cumulativePacketLoss >> 16) & 0xFF);
                        output.writeShort((cumulativePacketLoss & 0xFFFF));
                        output.writeInt((int) (extendedHighestSequenceNumber & 0xFFFFFFFF));
                        output.writeInt((int) (jitter & 0xFFFFFFFF));
                        output.writeShort((int) (lsrMSW & 0xFFFF));
View Full Code Here

                            DLSR = ((now - stream.getLastSRReportTime()) * 65536) / 1000;
                        }

                        output.writeInt((int) (stream.getSSRC() & 0xFFFFFFFF));
                        output.writeByte((int)(lossFraction & 0xFF));
                        output.writeByte((cumulativePacketLoss >> 16) & 0xFF);
                        output.writeShort((cumulativePacketLoss & 0xFFFF));
                        output.writeInt((int) (extendedHighestSequenceNumber & 0xFFFFFFFF));
                        output.writeInt((int) (jitter & 0xFFFFFFFF));
                        output.writeShort((int) (lsrMSW & 0xFFFF));
                        output.writeShort((int) ((lsrLSW >> 16) & 0xFFFF));
View Full Code Here

                    packetType = RTCPPacket.PT_SR;
                    packetSize = 6;
                }

                // Send a empty RR/SR packet ( must be always the first rtcp packet in a compound packet )
                output.writeByte(0x80);
                output.writeByte(packetType & 0xFF);
                output.writeShort(packetSize);

                if ( we_sent )
                {
View Full Code Here

                    packetSize = 6;
                }

                // Send a empty RR/SR packet ( must be always the first rtcp packet in a compound packet )
                output.writeByte(0x80);
                output.writeByte(packetType & 0xFF);
                output.writeShort(packetSize);

                if ( we_sent )
                {
                    writeSenderInfo(output, sendStream);
View Full Code Here

                    padding = 4 - (byelen % 4);
                    byelen += padding;
                }

                // Send a goodbye packet ( must be the last packet in a compound packet )
                output.writeByte(0x81);
                output.writeByte(RTCPPacket.PT_BYE & 0xFF);
                output.writeShort(byelen / 4);
                output.writeInt((int)(ssrc & 0xFFFFFFFF));

                // Goodbye RTCP Packet, send the reason for leaving
View Full Code Here

                    byelen += padding;
                }

                // Send a goodbye packet ( must be the last packet in a compound packet )
                output.writeByte(0x81);
                output.writeByte(RTCPPacket.PT_BYE & 0xFF);
                output.writeShort(byelen / 4);
                output.writeInt((int)(ssrc & 0xFFFFFFFF));

                // Goodbye RTCP Packet, send the reason for leaving
                if ( (null != reason) && (reason.length() > 0) )
View Full Code Here

                // Goodbye RTCP Packet, send the reason for leaving
                if ( (null != reason) && (reason.length() > 0) )
                {
                    byte[] reasonBytes = reason.getBytes("UTF-8");
                    output.writeByte(reasonBytes.length & 0xFF);
                    output.write(reasonBytes);

                    for (int i=0; i<padding; i++)
                    {
                        output.writeByte(0);
View Full Code Here

                    output.writeByte(reasonBytes.length & 0xFF);
                    output.write(reasonBytes);

                    for (int i=0; i<padding; i++)
                    {
                        output.writeByte(0);
                    }
                }

                output.close();
                bytes.close();
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.