I Have two files one sending, one receiving. I have the connection between the two.
can send text with :
// Prepare a message
messageToSend = "text that is sent";
lengthMessageToSend = messageToSend.length();
sendingBuffer = messageToSend.getBytes();
// Send the message
myLink.sendFrame(sendingBuffer, lengthMessageToSend);
System.out.println(lengthMessageToSend);
And Receive with :
// Display the message
messageReceived = new String(receivingBuffer, 0, lengthMessageReceived);
System.out.println("Message received is: [" + messageReceived + "]");
// Prepare a message
messageToSend = "1";
lengthMessageToSend = messageToSend.length();
sendingBuffer = messageToSend.getBytes();
// Send the message
myLink.sendFrame(sendingBuffer, lengthMessageToSend);
The text I am trying to now send is from a .txt, but just to send 16 bytes at a time within a payload:
[ SEQ | LEN | PAYLOAD | CHECKSUM ] --> for a total Header of 19 bytes.
What would the best way of doing this ?
Just reading in 16 bytes(8 characters) at a time?? If so How?
Aucun commentaire:
Enregistrer un commentaire