38 |
*/ |
*/ |
39 |
package gnu.java.net.protocol.file; |
package gnu.java.net.protocol.file; |
40 |
|
|
41 |
|
import java.io.BufferedInputStream; |
42 |
|
import java.io.BufferedOutputStream; |
43 |
import java.io.File; |
import java.io.File; |
44 |
import java.io.FileInputStream; |
import java.io.FileInputStream; |
45 |
import java.io.FileNotFoundException; |
import java.io.FileNotFoundException; |
73 |
/** |
/** |
74 |
* InputStream if we are reading from the file |
* InputStream if we are reading from the file |
75 |
*/ |
*/ |
76 |
private FileInputStream inputStream; |
private BufferedInputStream inputStream; |
77 |
|
|
78 |
/** |
/** |
79 |
* OutputStream if we are writing to the file |
* OutputStream if we are writing to the file |
80 |
*/ |
*/ |
81 |
private FileOutputStream outputStream; |
private BufferedOutputStream outputStream; |
82 |
|
|
83 |
/** |
/** |
84 |
* Calls superclass constructor to initialize. |
* Calls superclass constructor to initialize. |
107 |
throw new FileNotFoundException (file.getPath()); |
throw new FileNotFoundException (file.getPath()); |
108 |
|
|
109 |
if (doInput) |
if (doInput) |
110 |
inputStream = new FileInputStream (file); |
inputStream = new BufferedInputStream (new FileInputStream (file)); |
111 |
|
|
112 |
if (doOutput) |
if (doOutput) |
113 |
outputStream = new FileOutputStream (file); |
outputStream = new BufferedOutputStream (new FileOutputStream (file)); |
114 |
|
|
115 |
connected = true; |
connected = true; |
116 |
} |
} |