Input and output using runtime

I want to carry out a DOS command through java. To start DOS i use Runtime DOS = Runtime.getRunTime();DOS.exec("command.com");How do i / can i set up an input and output stream to pass commands to the newly opened DOS window and get the response?
[281 byte] By [amccrea] at [2007-9-26 13:18:13]
# 1
exec() returns a Process object. You can obtain stdout and stdin of this Process through its methods getInputStream() and getOutputStream().Don't fit into native methods though ...
thpreusser at 2007-7-2 13:29:52 > top of Java-index,Java HotSpot Virtual Machine,Specifications...
# 2
Have these methods not been deprecated since JDK1.1? It says you can replace them using outputstreamreader and writer - how is this done?Thanks.
amccrea at 2007-7-2 13:29:52 > top of Java-index,Java HotSpot Virtual Machine,Specifications...
# 3
None of the methods I mentioned have been deprecated. Readers and Writers are, however, the proper way to interface to text streams. This means, they are another level of abstraction on top of the stream, they do, however, not replace it.
thpreusser at 2007-7-2 13:29:52 > top of Java-index,Java HotSpot Virtual Machine,Specifications...