Path
-- API similar to File, but supports URLs as well as
paths.
ReadStream
-- buffered read stream handing both
byte and character input
WriteStream
-- buffered write stream handling both
byte and character output
Path access is based on standard URLs. The following URL schemes are predefined.
ReadStream
implements InputStream
so it can be
used wherever an InputStream
is appropriate.
The Vfs
facade is convenient for opening files.
ReadStream rs = Vfs.openRead("http://www.yahoo.com");
int ch;
while ((ch = rs.read()) >= 0)
System.out.print((char) ch);
WriteStream
implements OutputStream
so it can be
used wherever an OutputStream
is appropriate. It also implements
the familiar print()
methods from PrintStream
,
although they do throw IOExceptions.
The Vfs
facade is convenient for opening files.
WriteStream ws = Vfs.openWrite("mailto:user@foo.com");
ws.setAttribute("subject", "hi, there");
ws.println("Just a little hello, world message");
ws.close();