Uploaded image for project: 'Commons Net'
  1. Commons Net
  2. NET-497

ToNetASCIIInputStream skips LF at the end of the stream

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Not A Problem
    • 3.1
    • None
    • Telnet, TFTP
    • None

    Description

      I have the following failing test case for ToNetASCIIInputStream:

          public void testToNetASCIIInputStream() throws Exception
          {
              final Charset ASCII = Charset.forName("ASCII");
              byte[] data = "Hello\nWorld\n".getBytes(ASCII);
              InputStream source = new ByteArrayInputStream(data);
              ToNetASCIIInputStream toNetASCII = new ToNetASCIIInputStream(source);
              byte[] output = new byte[512];
              int length = toNetASCII.read(output);
              byte[] result = new byte[length];
              System.arraycopy(output, 0, result, 0, length);
              assertEquals('\r', result[length-2]);
              assertEquals('\n', result[length-1]);
          }
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            mirko@raner.ws Mirko Raner
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - 1h
                1h
                Remaining:
                Remaining Estimate - 1h
                1h
                Logged:
                Time Spent - Not Specified
                Not Specified