Don't use classes in the java.io package whose names end “Stream” for text files. Use classes whose names end “Reader” or “Writer”. The classes you are using don't work at all well with text files.
Don't use the read() method for text files, except possibly to demonstrate how badly it works. The low‑level classes e.g. file input stream work with one character/int at a time and the buffered classes collect lots of data and they work a line at a time. Buffered classes will therefore give faster performance.
Your code is not indented consistently; please remove some of the blank lines too. The names of your class and variable are also poorly chosen; nobody can work out what tr means.
Actually I would use a Scanner and a Formatter, which are easier to use because they “consume” Exceptions. You can read about the IO classes in the Java™ Tutorials.
If you're just copying from one file to another then a simple FileInputStream and FileOutputStream are all you need.
If you don't need the data in it there's no point with the overhead of Scanners or Buffering.
That is, of course, if you are forced to use those classes and not stuff in nio.
sarojni agrwal wrote:In this example outputt.txt blank, it did not take any input from inputt.txt why? while if I remove BufferedInput and OutputStream , then directly data goes on perfectly...
Since you didn't close your output stream, the data in the last buffer didn't get written out to the underlying file. I assume the input was small enough so that it fit into a single buffer and therefore nothing got written out. You should always close resources like that, either in a finally block or in a try-with-resources statement.
At least I'm guessing that's what happened. Your statement that no data was read from the input file might have been a conclusion based on the fact that you saw nothing in the output file, but it isn't good practice to draw such a conclusion and then start looking for the problem. It's better to start with the actual observed problem. Or did you actually have some evidence that the input data wasn't being read?