@Test public void testGetLsaBodyAsByteArray() throws Exception { result2 = summaryLsa.getLsaBodyAsByteArray(); assertThat(result2, is(notNullValue())); }
public byte[] getLsaBodyAsByteArray() { List<Byte> bodyLst = new ArrayList<>(); try { bodyLst.addAll(Bytes.asList(this.networkMask().toOctets())); bodyLst.add((byte) 0); bodyLst.addAll(Bytes.asList(OspfUtil.convertToThreeBytes(this.metric()))); } catch (Exception e) { log.debug("Error::getLsrBodyAsByteArray {}", e.getMessage()); return Bytes.toArray(bodyLst); } return Bytes.toArray(bodyLst); }
SummaryLsa extends LsaHeader { public byte[] getLsaBodyAsByteArray() { List<Byte> bodyLst = new ArrayList<>(); try { bodyLst.addAll(Bytes.asList(this.networkMask().toOctets())); bodyLst.add((byte) 0); bodyLst.addAll(Bytes.asList(OspfUtil.convertToThreeBytes(this.metric()))); } catch (Exception e) { log.debug("Error::getLsrBodyAsByteArray {}", e.getMessage()); return Bytes.toArray(bodyLst); } return Bytes.toArray(bodyLst); } }
SummaryLsa extends LsaHeader { public byte[] getLsaBodyAsByteArray() { List<Byte> bodyLst = new ArrayList<>(); try { bodyLst.addAll(Bytes.asList(this.networkMask().toOctets())); bodyLst.add((byte) 0); bodyLst.addAll(Bytes.asList(OspfUtil.convertToThreeBytes(this.metric()))); } catch (Exception e) { log.debug("Error::getLsrBodyAsByteArray {}", e.getMessage()); return Bytes.toArray(bodyLst); } return Bytes.toArray(bodyLst); } SummaryLsa(LsaHeader lsaHeader); }
SummaryLsa extends LsaHeader { public byte[] getLsaBodyAsByteArray() { List<Byte> bodyLst = new ArrayList<>(); try { bodyLst.addAll(Bytes.asList(this.networkMask().toOctets())); bodyLst.add((byte) 0); bodyLst.addAll(Bytes.asList(OspfUtil.convertToThreeBytes(this.metric()))); } catch (Exception e) { log.debug("Error::getLsrBodyAsByteArray {}", e.getMessage()); return Bytes.toArray(bodyLst); } return Bytes.toArray(bodyLst); } SummaryLsa(LsaHeader lsaHeader); Ip4Address networkMask(); void setNetworkMask(Ip4Address networkMask); int metric(); void setMetric(int metric); void readFrom(ChannelBuffer channelBuffer); byte[] asBytes(); byte[] getLsaBodyAsByteArray(); @Override OspfLsaType getOspfLsaType(); @Override String toString(); @Override boolean equals(Object o); @Override int hashCode(); }
SummaryLsa extends LsaHeader { public byte[] getLsaBodyAsByteArray() { List<Byte> bodyLst = new ArrayList<>(); try { bodyLst.addAll(Bytes.asList(this.networkMask().toOctets())); bodyLst.add((byte) 0); bodyLst.addAll(Bytes.asList(OspfUtil.convertToThreeBytes(this.metric()))); } catch (Exception e) { log.debug("Error::getLsrBodyAsByteArray {}", e.getMessage()); return Bytes.toArray(bodyLst); } return Bytes.toArray(bodyLst); } SummaryLsa(LsaHeader lsaHeader); Ip4Address networkMask(); void setNetworkMask(Ip4Address networkMask); int metric(); void setMetric(int metric); void readFrom(ChannelBuffer channelBuffer); byte[] asBytes(); byte[] getLsaBodyAsByteArray(); @Override OspfLsaType getOspfLsaType(); @Override String toString(); @Override boolean equals(Object o); @Override int hashCode();  }