From cc523d3b92af618a3f6bfa8d78470d99383fb08d Mon Sep 17 00:00:00 2001 From: tobia <tobia@Ryzen7-Tobi.fritz.box> Date: Mon, 9 Sep 2019 22:49:09 -0700 Subject: [PATCH] --- .../Brennenstuhl/Version2/AllPduSender.java | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/assignments/src/MV3500Cohort2019JulySeptember/homework4/Brennenstuhl/Version2/AllPduSender.java b/assignments/src/MV3500Cohort2019JulySeptember/homework4/Brennenstuhl/Version2/AllPduSender.java index f2a6244cd8..a1607920c2 100755 --- a/assignments/src/MV3500Cohort2019JulySeptember/homework4/Brennenstuhl/Version2/AllPduSender.java +++ b/assignments/src/MV3500Cohort2019JulySeptember/homework4/Brennenstuhl/Version2/AllPduSender.java @@ -57,10 +57,6 @@ public class AllPduSender Pdu aPdu = null; // edu.​nps.​moves7.​dis.PDU superclass for all PDUs, in preparation for custom assignment - - - - //*************************************************************************** CommentPdu newCommentPdu = new CommentPdu(); ArrayList<VariableDatum> payloadList = new ArrayList<VariableDatum>(); @@ -68,17 +64,11 @@ public class AllPduSender ArrayList<String> commentsList = new ArrayList<>(); commentsList.add("Hello CommentPDU"); commentsList.add("Chuck Norris is comming to town from IP-Adress " + DEFAULT_MULTICAST_ADDRESS + " with Port " + DEFAULT_MULTICAST_PORT); - - if (!commentsList.isEmpty()) - System.out.println("Preparing CommentPDU:"); - + for (String comment : commentsList) { VariableDatum newVariableDatum = new VariableDatum(); - newVariableDatum.setVariableDatumValue (comment.getBytes()); // conversion - //newVariableDatum.setVariableDatumLength(comment.getBytes().length * 8); // bits, not bytes, see spec and javadoc - // alternatively, you do not need to set this and the marshaller will figure it out from the byte array - // (see javadoc for VariableDatum.setVariableDatumLength()) + newVariableDatum.setVariableDatumValue (comment.getBytes()); payloadList.add(newVariableDatum); System.out.println(" \"" + comment + "\""); } -- GitLab