BufferedInputStream in Java
font SIZE="2" COLOR="#7f0055">
import
java.io.BufferedInputStream;
import
java.io.ByteArrayInputStream;
import
java.io.IOException;
import
java.io.InputStream;
/**
*
*/
/**
*
@author
venugopal
darur
*
*/
public
class
BufferedInputStreamDemo {
/**
*
@param
args
*/
public
static
void
main(String[] args) {
String name= "www.iforerunner.com";
byte
[] nameBytes = name.getBytes();
InputStream byteArrayInputStream= new
ByteArrayInputStream(nameBytes);
BufferedInputStream
bufferedInputStream =
new
BufferedInputStream(byteArrayInputStream);
int
someChar;
try
{
while((
someChar=bufferedInputStream.read() ) != -1)
{
System. out.print((char)someChar);
}
}
catch
(IOException e) {
e.printStackTrace();
}
}
}
output:
www.iforerunner.com
Please send comments to vgdarur.javafive@blogger.com
|