- Joined
- Oct 6, 2006
- Messages
- 1
- Reaction score
- 0
Hi,
//I am initializinng the URL object
URL addr = new URL("http://sfbay.craigslist.org/rid/");
//Opening a bufferedinputstream object
BufferedInputStream bin = new BufferedInputStream(addr.openStream());
//Initialize a Stringbuffer
StringBuffer bfr = new StringBuffer();
//Declare a byte array
byte[] b = new byte[1024];
???????? I dont understand what these following two lines do
for (int n; (n = bin.read(b)) != -1 {
bfr.append(new String(b, 0, n));
//This returns the string value the StringBuffer
bfr.toString()
Can someone explain this.
Thanks,
pandu
//I am initializinng the URL object
URL addr = new URL("http://sfbay.craigslist.org/rid/");
//Opening a bufferedinputstream object
BufferedInputStream bin = new BufferedInputStream(addr.openStream());
//Initialize a Stringbuffer
StringBuffer bfr = new StringBuffer();
//Declare a byte array
byte[] b = new byte[1024];
???????? I dont understand what these following two lines do
for (int n; (n = bin.read(b)) != -1 {
bfr.append(new String(b, 0, n));
//This returns the string value the StringBuffer
bfr.toString()
Can someone explain this.
Thanks,
pandu