@Test public void testGetMessageLengthThrowsNullPointerException() throws Throwable { CSChannel cSChannel = new CSChannel(); try { cSChannel.getMessageLength(); fail("Expected NullPointerException to be thrown"); } catch (NullPointerException ex) { if (isJavaVersionAtMost(JAVA_14)) { assertNull(ex.getMessage(), "ex.getMessage()"); } else { assertEquals("Cannot invoke \"java.io.DataInputStream.readFully(byte[], int, int)\" because \"this.serverIn\" is null", ex.getMessage(), "ex.getMessage()"); } } }
protected int getMessageLength() throws IOException, ISOException { int l = 0; byte[] b = new byte[4]; while (l == 0) { serverIn.readFully(b,0,4); l = ((int)b[0] &0xFF) << 8 | (int)b[1] &0xFF; if (replyKeepAlive && l == 0) { synchronized (serverOutLock) { serverOut.write(b); serverOut.flush(); } } } return l; }
CSChannel extends BaseChannel { protected int getMessageLength() throws IOException, ISOException { int l = 0; byte[] b = new byte[4]; while (l == 0) { serverIn.readFully(b,0,4); l = ((int)b[0] &0xFF) << 8 | (int)b[1] &0xFF; if (replyKeepAlive && l == 0) { synchronized (serverOutLock) { serverOut.write(b); serverOut.flush(); } } } return l; } }
CSChannel extends BaseChannel { protected int getMessageLength() throws IOException, ISOException { int l = 0; byte[] b = new byte[4]; while (l == 0) { serverIn.readFully(b,0,4); l = ((int)b[0] &0xFF) << 8 | (int)b[1] &0xFF; if (replyKeepAlive && l == 0) { synchronized (serverOutLock) { serverOut.write(b); serverOut.flush(); } } } return l; } CSChannel();  CSChannel(String host, int port, ISOPackager p);  CSChannel(ISOPackager p);  CSChannel(ISOPackager p, ServerSocket serverSocket); }
CSChannel extends BaseChannel { protected int getMessageLength() throws IOException, ISOException { int l = 0; byte[] b = new byte[4]; while (l == 0) { serverIn.readFully(b,0,4); l = ((int)b[0] &0xFF) << 8 | (int)b[1] &0xFF; if (replyKeepAlive && l == 0) { synchronized (serverOutLock) { serverOut.write(b); serverOut.flush(); } } } return l; } CSChannel();  CSChannel(String host, int port, ISOPackager p);  CSChannel(ISOPackager p);  CSChannel(ISOPackager p, ServerSocket serverSocket); @Override void setConfiguration(Configuration cfg); }
CSChannel extends BaseChannel { protected int getMessageLength() throws IOException, ISOException { int l = 0; byte[] b = new byte[4]; while (l == 0) { serverIn.readFully(b,0,4); l = ((int)b[0] &0xFF) << 8 | (int)b[1] &0xFF; if (replyKeepAlive && l == 0) { synchronized (serverOutLock) { serverOut.write(b); serverOut.flush(); } } } return l; } CSChannel();  CSChannel(String host, int port, ISOPackager p);  CSChannel(ISOPackager p);  CSChannel(ISOPackager p, ServerSocket serverSocket); @Override void setConfiguration(Configuration cfg);  }