Uploaded image for project: 'Harmony'
  1. Harmony
  2. HARMONY-6576

[classlib][luni] PipedOutputStream.write throws PipeNotConnected Exception

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 5.0M14
    • 5.0M15
    • Classlib
    • None
    • Patch Available

    Description

      The below testcase throws PipeNotConnected exception when trying to write
      a zero byte array just after closing the stream.

      The exception should not be thrown as there is no byte to write.

      import java.io.*;
      public class Test{
      public static void main(String [] args){
      try

      { PipedInputStream in = new PipedInputStream(); PipedOutputStream out = new PipedOutputStream(in); out.close(); out.write(new byte[0]); out.close(); }

      catch(IOException e )

      { e.printStackTrace(); }

      }
      }

      Attachments

        1. Harmony-6576.diff
          2 kB
          Xiao Shu
        2. Harmony-6576_v2.diff
          2 kB
          Xiao Shu

        Activity

          People

            regis_xu Regis Xu
            xiaoshu Xiao Shu
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: