@Test public void testSendMessageLengthThrowsIOException() throws Throwable { ASCIIChannel aSCIIChannel = new ASCIIChannel(); try { aSCIIChannel.sendMessageLength(10000); fail("Expected IOException to be thrown"); } catch (IOException ex) { assertEquals(IOException.class, ex.getClass(), "ex.getClass()"); } }
protected void sendMessageLength(int len) throws IOException { int maxLen= ten.pow(lengthDigits).intValue() - 1; if (len > maxLen) throw new IOException ("len exceeded ("+len+" > "+maxLen+")"); else if (len < 0) throw new IOException ("invalid negative length ("+len+")"); serverOut.write(ISOUtil.zeropad(len, lengthDigits).getBytes()); }
ASCIIChannel extends BaseChannel { protected void sendMessageLength(int len) throws IOException { int maxLen= ten.pow(lengthDigits).intValue() - 1; if (len > maxLen) throw new IOException ("len exceeded ("+len+" > "+maxLen+")"); else if (len < 0) throw new IOException ("invalid negative length ("+len+")"); serverOut.write(ISOUtil.zeropad(len, lengthDigits).getBytes()); } }
ASCIIChannel extends BaseChannel { protected void sendMessageLength(int len) throws IOException { int maxLen= ten.pow(lengthDigits).intValue() - 1; if (len > maxLen) throw new IOException ("len exceeded ("+len+" > "+maxLen+")"); else if (len < 0) throw new IOException ("invalid negative length ("+len+")"); serverOut.write(ISOUtil.zeropad(len, lengthDigits).getBytes()); } ASCIIChannel();  ASCIIChannel(String host, int port, ISOPackager p);  ASCIIChannel(ISOPackager p);  ASCIIChannel(ISOPackager p, ServerSocket serverSocket); }
ASCIIChannel extends BaseChannel { protected void sendMessageLength(int len) throws IOException { int maxLen= ten.pow(lengthDigits).intValue() - 1; if (len > maxLen) throw new IOException ("len exceeded ("+len+" > "+maxLen+")"); else if (len < 0) throw new IOException ("invalid negative length ("+len+")"); serverOut.write(ISOUtil.zeropad(len, lengthDigits).getBytes()); } ASCIIChannel();  ASCIIChannel(String host, int port, ISOPackager p);  ASCIIChannel(ISOPackager p);  ASCIIChannel(ISOPackager p, ServerSocket serverSocket); void setLengthDigits(int len); int getLengthDigits(); @Override void setConfiguration(Configuration cfg); }
ASCIIChannel extends BaseChannel { protected void sendMessageLength(int len) throws IOException { int maxLen= ten.pow(lengthDigits).intValue() - 1; if (len > maxLen) throw new IOException ("len exceeded ("+len+" > "+maxLen+")"); else if (len < 0) throw new IOException ("invalid negative length ("+len+")"); serverOut.write(ISOUtil.zeropad(len, lengthDigits).getBytes()); } ASCIIChannel();  ASCIIChannel(String host, int port, ISOPackager p);  ASCIIChannel(ISOPackager p);  ASCIIChannel(ISOPackager p, ServerSocket serverSocket); void setLengthDigits(int len); int getLengthDigits(); @Override void setConfiguration(Configuration cfg);  }