@Test public void testGetMessageThrowsNullPointerException() throws Throwable { byte[] b = new byte[2]; GZIPChannel gZIPChannel = new GZIPChannel(); try { gZIPChannel.getMessage(b, 100, 1000); fail("Expected NullPointerException to be thrown"); } catch (NullPointerException ex) { assertNull(ex.getMessage(), "ex.getMessage()"); } }
protected void getMessage (byte[] b, int offset, int len) throws IOException, ISOException { int total = 0; GZIPInputStream gzip = new GZIPInputStream(serverIn); while (total < len) { int nread = gzip.read (b, offset, len - total); if (nread == -1) { throw new ISOException("End of compressed stream reached before all data was read"); } total += nread; offset += nread; } }
GZIPChannel extends BaseChannel { protected void getMessage (byte[] b, int offset, int len) throws IOException, ISOException { int total = 0; GZIPInputStream gzip = new GZIPInputStream(serverIn); while (total < len) { int nread = gzip.read (b, offset, len - total); if (nread == -1) { throw new ISOException("End of compressed stream reached before all data was read"); } total += nread; offset += nread; } } }
GZIPChannel extends BaseChannel { protected void getMessage (byte[] b, int offset, int len) throws IOException, ISOException { int total = 0; GZIPInputStream gzip = new GZIPInputStream(serverIn); while (total < len) { int nread = gzip.read (b, offset, len - total); if (nread == -1) { throw new ISOException("End of compressed stream reached before all data was read"); } total += nread; offset += nread; } } GZIPChannel();  GZIPChannel(String host, int port, ISOPackager p);  GZIPChannel(ISOPackager p);  GZIPChannel(ISOPackager p, ServerSocket serverSocket); }
GZIPChannel extends BaseChannel { protected void getMessage (byte[] b, int offset, int len) throws IOException, ISOException { int total = 0; GZIPInputStream gzip = new GZIPInputStream(serverIn); while (total < len) { int nread = gzip.read (b, offset, len - total); if (nread == -1) { throw new ISOException("End of compressed stream reached before all data was read"); } total += nread; offset += nread; } } GZIPChannel();  GZIPChannel(String host, int port, ISOPackager p);  GZIPChannel(ISOPackager p);  GZIPChannel(ISOPackager p, ServerSocket serverSocket);  }
GZIPChannel extends BaseChannel { protected void getMessage (byte[] b, int offset, int len) throws IOException, ISOException { int total = 0; GZIPInputStream gzip = new GZIPInputStream(serverIn); while (total < len) { int nread = gzip.read (b, offset, len - total); if (nread == -1) { throw new ISOException("End of compressed stream reached before all data was read"); } total += nread; offset += nread; } } GZIPChannel();  GZIPChannel(String host, int port, ISOPackager p);  GZIPChannel(ISOPackager p);  GZIPChannel(ISOPackager p, ServerSocket serverSocket);   }