Search Results

Search found 4 results on 1 pages for 'corleone'.

Page 1/1 | 1 

  • Filling a byte array in Java

    - by Corleone
    Hey all! For part of a project I'm working on I am implementing a RTPpacket where I have to fill the header array of byte with RTP header fields. //size of the RTP header: static int HEADER_SIZE = 12; // bytes //Fields that compose the RTP header public int Version; // 2 bits public int Padding; // 1 bit public int Extension; // 1 bit public int CC; // 4 bits public int Marker; // 1 bit public int PayloadType; // 7 bits public int SequenceNumber; // 16 bits public int TimeStamp; // 32 bits public int Ssrc; // 32 bits //Bitstream of the RTP header public byte[] header = new byte[ HEADER_SIZE ]; This was my approach: /* * bits 0-1: Version * bit 2: Padding * bit 3: Extension * bits 4-7: CC */ header[0] = new Integer( (Version << 6)|(Padding << 5)|(Extension << 6)|CC ).byteValue(); /* * bit 0: Marker * bits 1-7: PayloadType */ header[1] = new Integer( (Marker << 7)|PayloadType ).byteValue(); /* SequenceNumber takes 2 bytes = 16 bits */ header[2] = new Integer( SequenceNumber >> 8 ).byteValue(); header[3] = new Integer( SequenceNumber ).byteValue(); /* TimeStamp takes 4 bytes = 32 bits */ for ( int i = 0; i < 4; i++ ) header[7-i] = new Integer( TimeStamp >> (8*i) ).byteValue(); /* Ssrc takes 4 bytes = 32 bits */ for ( int i = 0; i < 4; i++ ) header[11-i] = new Integer( Ssrc >> (8*i) ).byteValue(); Any other, maybe 'better' ways to do this?

    Read the article

  • SSH X11 Tunneling

    - by Corleone
    Hey all, I'm running Ubuntu 9.10 and trying to run a Java program I wrote whose source code is located on a remote machine. I'm using ssh to connect using the following command from the terminal: ssh -X username@hostname When running the program, one of the GUI frames has its buttons missing from view, but they are clickable and work as expected when I can guess accurately where they are. Running the code from my local machine they are present, and running from another windows machine using X-Windows they are present. Been trying to solve this problem for a few hours now but to no avail. Anyone have any helpful insight how to resolve this issue? Thanks!

    Read the article

  • servlet resopnse data for autocomplete

    - by shams haque
    Hello experts, Following code is in php. i want to do same in java. Please tell me how do i generate this type of array or collection in java. I need this to response to json autocomplete. <?php $q = strtolower($_GET["q"]); if (!$q) return; $items = array( "Peter Pan"=>"[email protected]", "Molly"=>"[email protected]", "Forneria Marconi"=>"[email protected]", "Master Sync"=>"[email protected]", "Dr. Tech de Log"=>"[email protected]", "Don Corleone"=>"[email protected]", "Mc Chick"=>"[email protected]", "Donnie Darko"=>"[email protected]", "Quake The Net"=>"[email protected]", "Dr. Write"=>"[email protected]" ); $result = array(); foreach ($items as $key=>$value) { if (strpos(strtolower($key), $q) !== false) { array_push($result, array( "name" => $key, "to" => $value )); } } echo json_encode($result); ?>

    Read the article

1