@Test public void testGetLinkSubTypeTlvBodyAsByteArray() throws Exception { result = localInterfaceIpAddress.getLinkSubTypeTlvBodyAsByteArray(); assertThat(result, is(notNullValue())); }
public byte[] getLinkSubTypeTlvBodyAsByteArray() throws Exception { List<Byte> linkSubTypeBody = new ArrayList<>(); for (String remoteAddress : this.localInterfaceIPAddress) { try { linkSubTypeBody.addAll(Bytes.asList(InetAddress.getByName(remoteAddress).getAddress())); } catch (Exception e) { log.debug("Error::getLinkSubTypeTlvBodyAsByteArray:: {}", e.getMessage()); throw new OspfParseException(OspfErrorType.OSPF_MESSAGE_ERROR, OspfErrorType.BAD_MESSAGE); } } return Bytes.toArray(linkSubTypeBody); }
LocalInterfaceIpAddress extends TlvHeader implements LinkSubType { public byte[] getLinkSubTypeTlvBodyAsByteArray() throws Exception { List<Byte> linkSubTypeBody = new ArrayList<>(); for (String remoteAddress : this.localInterfaceIPAddress) { try { linkSubTypeBody.addAll(Bytes.asList(InetAddress.getByName(remoteAddress).getAddress())); } catch (Exception e) { log.debug("Error::getLinkSubTypeTlvBodyAsByteArray:: {}", e.getMessage()); throw new OspfParseException(OspfErrorType.OSPF_MESSAGE_ERROR, OspfErrorType.BAD_MESSAGE); } } return Bytes.toArray(linkSubTypeBody); } }
LocalInterfaceIpAddress extends TlvHeader implements LinkSubType { public byte[] getLinkSubTypeTlvBodyAsByteArray() throws Exception { List<Byte> linkSubTypeBody = new ArrayList<>(); for (String remoteAddress : this.localInterfaceIPAddress) { try { linkSubTypeBody.addAll(Bytes.asList(InetAddress.getByName(remoteAddress).getAddress())); } catch (Exception e) { log.debug("Error::getLinkSubTypeTlvBodyAsByteArray:: {}", e.getMessage()); throw new OspfParseException(OspfErrorType.OSPF_MESSAGE_ERROR, OspfErrorType.BAD_MESSAGE); } } return Bytes.toArray(linkSubTypeBody); } LocalInterfaceIpAddress(TlvHeader header); }
LocalInterfaceIpAddress extends TlvHeader implements LinkSubType { public byte[] getLinkSubTypeTlvBodyAsByteArray() throws Exception { List<Byte> linkSubTypeBody = new ArrayList<>(); for (String remoteAddress : this.localInterfaceIPAddress) { try { linkSubTypeBody.addAll(Bytes.asList(InetAddress.getByName(remoteAddress).getAddress())); } catch (Exception e) { log.debug("Error::getLinkSubTypeTlvBodyAsByteArray:: {}", e.getMessage()); throw new OspfParseException(OspfErrorType.OSPF_MESSAGE_ERROR, OspfErrorType.BAD_MESSAGE); } } return Bytes.toArray(linkSubTypeBody); } LocalInterfaceIpAddress(TlvHeader header); void addLocalInterfaceIPAddress(String localAddress); List<String> getLocalInterfaceIPAddress(); void readFrom(ChannelBuffer channelBuffer); byte[] asBytes(); byte[] getLinkSubTypeTlvBodyAsByteArray(); @Override String toString(); }
LocalInterfaceIpAddress extends TlvHeader implements LinkSubType { public byte[] getLinkSubTypeTlvBodyAsByteArray() throws Exception { List<Byte> linkSubTypeBody = new ArrayList<>(); for (String remoteAddress : this.localInterfaceIPAddress) { try { linkSubTypeBody.addAll(Bytes.asList(InetAddress.getByName(remoteAddress).getAddress())); } catch (Exception e) { log.debug("Error::getLinkSubTypeTlvBodyAsByteArray:: {}", e.getMessage()); throw new OspfParseException(OspfErrorType.OSPF_MESSAGE_ERROR, OspfErrorType.BAD_MESSAGE); } } return Bytes.toArray(linkSubTypeBody); } LocalInterfaceIpAddress(TlvHeader header); void addLocalInterfaceIPAddress(String localAddress); List<String> getLocalInterfaceIPAddress(); void readFrom(ChannelBuffer channelBuffer); byte[] asBytes(); byte[] getLinkSubTypeTlvBodyAsByteArray(); @Override String toString();  }