Page 2 of 2 FirstFirst 12
Results 21 to 22 of 22
  1. #21
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Rep Power


    Then you'd need to know what the packets actually contain. It's quite possible they are broken up, with the first byte meaning something, the second couple meaning something else, then the next couple being used to say how long the message is, then the rest being the message with a stop byte at the end.

  2. #22
    Ben1 is offline Member
    Join Date
    Oct 2010
    Rep Power


    Just a follow up post really.

    Thanks for everyones help. I did finally get it working :)

    I used:
    //tempPacket = the variable used to hold the raw data straight off the NIC
    //packetString = the byte array used to hold the converted "data" from tempPacket
    //payload = the data as a string - final var for this stage.
    Packet tempPacket = captor.getPacket();
    if (tempPacket != null) {
    byte[] packetString =;
    String payload = new String(packetString);

    That prints out every packet is the exact format I was expecting. I then used my IF statement to only produce packets with MSG in them - All MSN message packets have this and some a few more unique characteristics.

    Thanks again

Page 2 of 2 FirstFirst 12

Similar Threads

  1. null values
    By jabo in forum New To Java
    Replies: 3
    Last Post: 03-31-2010, 04:44 PM
  2. Printing values from object in Array?
    By thesinter in forum New To Java
    Replies: 3
    Last Post: 01-20-2010, 06:19 AM
  3. How to get null values stored in array
    By Ms.Ranjan in forum New To Java
    Replies: 4
    Last Post: 05-21-2009, 11:29 PM
  4. Printing default Swing values
    By Java Tip in forum Java Tip
    Replies: 0
    Last Post: 03-12-2008, 12:09 PM
  5. how to read memory addresses
    By fred in forum New To Java
    Replies: 1
    Last Post: 07-24-2007, 02:59 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts