aspose file tools*
The moose likes Beginning Java and the fly likes Convert a BufferedReader varaible into an int? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Convert a BufferedReader varaible into an int?" Watch "Convert a BufferedReader varaible into an int?" New topic
Author

Convert a BufferedReader varaible into an int?

Rik Ny
Greenhorn

Joined: Oct 13, 2001
Posts: 13
I would like to know how to convert a BufferedReader varaible into an int for my switch statement?? Here's what i have so far...
public void sendto(BufferedReader response)
{
try
{
int option = response.read();
switch(option)
Manoj Chandran
Greenhorn

Joined: Jan 26, 2001
Posts: 25
Rik,
Your question is not clear.As far as what u asked it is not possible to convert a BufferedReader variable into int bcoz first one is an object and second one is a primitive type and ia not compatible.
But if u want to perform swtich depending on the characters read from the stream the you can safely use the read() method which returns an int representation of the next available character in the stream...
manoj chandran,
Software Engg,SSi


Thanks & Regards,

Manoj Chandran
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Convert a BufferedReader varaible into an int?