@Test public void testSendMessageHeaderThrowsNullPointerException() throws Throwable { byte[] TPDU = new byte[1]; NCCChannel nCCChannel = new NCCChannel(new ISO87BPackager(), TPDU, new ServerSocket()); ISOMsg m = new ISOMsg(); try { nCCChannel.sendMessageHeader(m, 100); fail("Expected NullPointerException to be thrown"); } catch (NullPointerException ex) { if (isJavaVersionAtMost(JAVA_14)) { assertNull(ex.getMessage(), "ex.getMessage()"); } else { assertEquals("Cannot invoke \"java.io.DataOutputStream.write(byte[])\" because \"this.serverOut\" is null", ex.getMessage(), "ex.getMessage()"); } } }
protected void sendMessageHeader(ISOMsg m, int len) throws IOException { byte[] h = m.getHeader(); if (h != null) { if (tpduSwap && h.length == 5) { byte[] tmp = new byte[2]; System.arraycopy (h, 1, tmp, 0, 2); System.arraycopy (h, 3, h, 1, 2); System.arraycopy (tmp, 0, h, 3, 2); } } else h = header ; if (h != null) serverOut.write(h); }
NCCChannel extends BaseChannel { protected void sendMessageHeader(ISOMsg m, int len) throws IOException { byte[] h = m.getHeader(); if (h != null) { if (tpduSwap && h.length == 5) { byte[] tmp = new byte[2]; System.arraycopy (h, 1, tmp, 0, 2); System.arraycopy (h, 3, h, 1, 2); System.arraycopy (tmp, 0, h, 3, 2); } } else h = header ; if (h != null) serverOut.write(h); } }
NCCChannel extends BaseChannel { protected void sendMessageHeader(ISOMsg m, int len) throws IOException { byte[] h = m.getHeader(); if (h != null) { if (tpduSwap && h.length == 5) { byte[] tmp = new byte[2]; System.arraycopy (h, 1, tmp, 0, 2); System.arraycopy (h, 3, h, 1, 2); System.arraycopy (tmp, 0, h, 3, 2); } } else h = header ; if (h != null) serverOut.write(h); } NCCChannel();  NCCChannel(String host, int port, ISOPackager p, byte[] TPDU);  NCCChannel(ISOPackager p, byte[] TPDU);  NCCChannel(ISOPackager p, byte[] TPDU, ServerSocket serverSocket); }
NCCChannel extends BaseChannel { protected void sendMessageHeader(ISOMsg m, int len) throws IOException { byte[] h = m.getHeader(); if (h != null) { if (tpduSwap && h.length == 5) { byte[] tmp = new byte[2]; System.arraycopy (h, 1, tmp, 0, 2); System.arraycopy (h, 3, h, 1, 2); System.arraycopy (tmp, 0, h, 3, 2); } } else h = header ; if (h != null) serverOut.write(h); } NCCChannel();  NCCChannel(String host, int port, ISOPackager p, byte[] TPDU);  NCCChannel(ISOPackager p, byte[] TPDU);  NCCChannel(ISOPackager p, byte[] TPDU, ServerSocket serverSocket); void setHeader(String header); void setConfiguration(Configuration cfg); }
NCCChannel extends BaseChannel { protected void sendMessageHeader(ISOMsg m, int len) throws IOException { byte[] h = m.getHeader(); if (h != null) { if (tpduSwap && h.length == 5) { byte[] tmp = new byte[2]; System.arraycopy (h, 1, tmp, 0, 2); System.arraycopy (h, 3, h, 1, 2); System.arraycopy (tmp, 0, h, 3, 2); } } else h = header ; if (h != null) serverOut.write(h); } NCCChannel();  NCCChannel(String host, int port, ISOPackager p, byte[] TPDU);  NCCChannel(ISOPackager p, byte[] TPDU);  NCCChannel(ISOPackager p, byte[] TPDU, ServerSocket serverSocket); void setHeader(String header); void setConfiguration(Configuration cfg);  }