X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=blobdiff_plain;f=opendaylight%2Fnetconf%2Fnetconf-util%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fnetconf%2Futil%2Fhandler%2FNetconfEXIToMessageDecoder.java;h=ae330d67e68344e16d1904b7c1547caea73cadb8;hp=cbfbfe1c05a21ebb5db74b5973ce32fc90f86c98;hb=79df3ca27a571091af4d8cf766ef81864aa70c2f;hpb=61bad4207cc91cd14d8d38a255ad6549c20ff54e diff --git a/opendaylight/netconf/netconf-util/src/main/java/org/opendaylight/controller/netconf/util/handler/NetconfEXIToMessageDecoder.java b/opendaylight/netconf/netconf-util/src/main/java/org/opendaylight/controller/netconf/util/handler/NetconfEXIToMessageDecoder.java index cbfbfe1c05..ae330d67e6 100644 --- a/opendaylight/netconf/netconf-util/src/main/java/org/opendaylight/controller/netconf/util/handler/NetconfEXIToMessageDecoder.java +++ b/opendaylight/netconf/netconf-util/src/main/java/org/opendaylight/controller/netconf/util/handler/NetconfEXIToMessageDecoder.java @@ -34,8 +34,6 @@ public final class NetconfEXIToMessageDecoder extends ByteToMessageDecoder { private static final Logger LOG = LoggerFactory.getLogger(NetconfEXIToMessageDecoder.class); -// private static final SAXTransformerFactory saxTransformerFactory = (SAXTransformerFactory)SAXTransformerFactory.newInstance(); - private final NetconfEXICodec codec; public NetconfEXIToMessageDecoder(final NetconfEXICodec codec) { @@ -50,9 +48,9 @@ public final class NetconfEXIToMessageDecoder extends ByteToMessageDecoder { * the use of EXI, which means the next message needs to be decoded not by us, but rather * by the XML decoder. */ - // If empty Byte buffer is passed to r.parse, EOFException is thrown - if (in.readableBytes() == 0) { + // If empty Byte buffer is passed to r.parse, EOFException is thrown + if (in.isReadable() == false) { LOG.debug("No more content in incoming buffer."); return; } @@ -69,7 +67,6 @@ public final class NetconfEXIToMessageDecoder extends ByteToMessageDecoder { final DOMResult domResult = new DOMResult(); handler.setResult(domResult); - try (final InputStream is = new ByteBufInputStream(in)) { r.parse(new InputSource(is)); }