Click here to Skip to main content
15,909,437 members
Home / Discussions / Java
   

Java

 
GeneralRe: Nokia 2323 DateTime Issue??? Pin
David Skelly15-Jun-10 6:40
David Skelly15-Jun-10 6:40 
GeneralRe: Nokia 2323 DateTime Issue??? Pin
Richard MacCutchan15-Jun-10 6:59
mveRichard MacCutchan15-Jun-10 6:59 
GeneralRe: Nokia 2323 DateTime Issue??? Pin
Member 211994515-Jun-10 14:17
Member 211994515-Jun-10 14:17 
QuestionHow can I add Resources with jar file? Pin
002comp13-Jun-10 18:20
002comp13-Jun-10 18:20 
AnswerRe: How can I add Resources with jar file? (Solved) Pin
002comp13-Jun-10 18:50
002comp13-Jun-10 18:50 
QuestionSending of byte array messages to an VB Receiving Emulator application Pin
pohcb_sonic10-Jun-10 18:43
pohcb_sonic10-Jun-10 18:43 
AnswerRe: Sending of byte array messages to an VB Receiving Emulator application Pin
Richard MacCutchan10-Jun-10 23:15
mveRichard MacCutchan10-Jun-10 23:15 
GeneralRe: Sending of byte array messages to an VB Receiving Emulator application [modified] Pin
pohcb_sonic14-Jun-10 14:40
pohcb_sonic14-Jun-10 14:40 
The messages sent is displayed in hexadecimal format and at the same time, sent in bytes through the java application.
The code is as follows:
public void Display_Msg(int SIZE){
       String S;
          int DisplayLen = 0;


          if (SIZE > txtSpd.getColumns()-1){

              for(int i = 0; i< txtSpd.getColumns(); i++){
                    //Convert converted arrayMsg to Hex in string (16 hexa), since Java's is 32Bits in byte
                   S = Integer.toString(ByteConversion(byteTxtMsg[i]), 16) + " ";
                   txtSpd.append(S);
               }
               txtSpd.append("\n");


               for(int j = txtSpd.getColumns()-1; j< SIZE; j++){
                //Convert converted arrayMsg to Hex in string (16 hexa), since Java's is 32Bits in byte

                   S = Integer.toString(ByteConversion(byteTxtMsg[j]), 16) + " ";
                   txtSpd.append(S);
                  DisplayLen = txtSpd.getLineCount();
                 }
                  txtSpd.append("\n");



               }




          if (SIZE <= txtSpd.getColumns()-1){


                   for(int i = 0; i< SIZE; i++){
                    //Convert converted int arrayMsg to Hex in string (16 hexa), since Java's is 32Bits in byte
                   S = Integer.toString(ByteConversion(byteTxtMsg[i]), 16) + " ";

                   txtSpd.append(S);
                   DisplayLen = txtSpd.getLineCount();
                }
                  txtSpd.append("\n");

           }




           if (DisplayLen > 18){
               txtSpd.setText("");
           }


            String dat1="";
             byte Msg[] = new byte[50];

           for (int k = 0; k<SIZE; k++){
             dat1 = Integer.toString(ByteConversion(byteTxtMsg[k]), 16) + " ";


           }

          Msg = dat1.getBytes();

          try{
            udpC.send(Msg);
          }

          catch (IOException w){
            System.out.println("Error: " + w);

           }

   }



udpC is the instance object of the UDPConnect class involved in the declarations of DatagramPackets and DatagramSockets.
the Send method in udpC class is called.

Following is the sending portion of send method in the UDPConnect class:


public void send(byte[] data) throws IOException {

    if (data.length > 8192) throw new IOException("Too much data");
    
    DatagramPacket dp = new DatagramPacket(data, data.length, remote, port);
   
    ds.send(dp);
    

  }



So far, the connection and receiving portion of my application in VB has no problems. The problem now is the decoding of the message portion, whereby the decoding of the messages received seems to be different from what I've send through in the Java application.

The sending and receiving of the messages is in bytes. Could it be that sending portion of the messages in bytes in Java has something to do with this, as it is known that the bytes in Java has some restrictions?
DA: http://www.pohcbsonic.deviantart.com/
Blog: http://www.pohcbsonicx.blogspot.com/
Homepage: http://www.pohcbsonic.tripod.com/
modified on Monday, June 14, 2010 8:47 PM

GeneralRe: Sending of byte array messages to an VB Receiving Emulator application Pin
Richard MacCutchan15-Jun-10 4:48
mveRichard MacCutchan15-Jun-10 4:48 
QuestionHow to resizethe backGround Image to JPanel? Pin
002comp9-Jun-10 1:48
002comp9-Jun-10 1:48 
AnswerRe: How to resizethe backGround Image to JPanel? Pin
David Skelly9-Jun-10 5:22
David Skelly9-Jun-10 5:22 
GeneralRe: How to resizethe backGround Image to JPanel? Pin
002comp9-Jun-10 17:52
002comp9-Jun-10 17:52 
GeneralRe: How to resizethe backGround Image to JPanel? Pin
David Skelly9-Jun-10 22:26
David Skelly9-Jun-10 22:26 
GeneralRe: How to resizethe backGround Image to JPanel? Pin
002comp10-Jun-10 1:05
002comp10-Jun-10 1:05 
QuestionDrop Down Pin
Wcmedic8-Jun-10 11:39
Wcmedic8-Jun-10 11:39 
AnswerRe: Drop Down Pin
Nagy Vilmos8-Jun-10 20:16
professionalNagy Vilmos8-Jun-10 20:16 
GeneralRe: Drop Down Pin
Wcmedic9-Jun-10 6:05
Wcmedic9-Jun-10 6:05 
GeneralStudent Report Program Pin
CodeScribbler7-Jun-10 20:45
CodeScribbler7-Jun-10 20:45 
GeneralRe: Student Report Program Pin
Richard MacCutchan7-Jun-10 21:47
mveRichard MacCutchan7-Jun-10 21:47 
GeneralStudent Report Program Pin
CodeScribbler7-Jun-10 22:46
CodeScribbler7-Jun-10 22:46 
GeneralRe: Student Report Program Pin
Richard MacCutchan8-Jun-10 3:42
mveRichard MacCutchan8-Jun-10 3:42 
GeneralRe: Student Report Program Pin
CodeScribbler9-Jun-10 3:34
CodeScribbler9-Jun-10 3:34 
GeneralRe: Student Report Program Pin
Richard MacCutchan9-Jun-10 4:29
mveRichard MacCutchan9-Jun-10 4:29 
QuestionHow to clone(Deep clone) instance variables in a class and it to the clone object of that class? Pin
PJanaki6-Jun-10 20:48
PJanaki6-Jun-10 20:48 
AnswerRe: How to clone(Deep clone) instance variables in a class and it to the clone object of that class? Pin
David Skelly6-Jun-10 22:24
David Skelly6-Jun-10 22:24 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.