Can't convert FileReader to java.io.Reader

Hi
I have a code segment that generates error during compilation of the source file: "Incompatible type for constructor. Can't convert FileReader to java.io.Reader.
     buffVideo = new BufferedReader (file)
     ^
The code segment is:
FileReader file;
BufferedReader buffVideo;
StreamTokenizer tokenVideo;
String s;
try {
     file = new FileReader (fileVideo);
     buffVideo = new BufferedReader (file);
     tokenVideo = new StreamTokenizer (buffVideo);
import java.io.* is at the top of the .java file. It is a part of a definition of a new class. fileVideo is a String variable containing file name of a text file.
Exactly the same .java source file compiles on a Windows 98 based machine, but not on a Windows 2000 Professional. I use version 1.1.6 as it is required by my current course.
Can anybody suggest any resoultion for this problem, please?
Thanks in advance

Branko,
Wow, my ID still works. Amazing, I haven't visited for years.
Ged Byrne writes:
Branko,
This is a realy puzzler. My only guess is that you have a namespace
conflict. The error message states:
Can't convert File Reader to java.io.Reader
It seems that there is another class called FileReader that is clashing
with the on in java.io.
Have you inadvertantly named something FileReader yourself?
Perhaps your classpath is including something that contains a FileReader.
Try declaring file as java.io.FileReader rather than just FileReader.
I'm clutching at straws.
Ged.

Similar Messages

  • Can't convert int to java.lang.Integer.

    Hi everyone.
    I'm working on an auction site at the moment and have problems gaining a bidID number. This is part of my code and my error.
    AuctionFacade aHse = (AuctionFacade) application.getAttribute("AuctionFacade");
    String strTraderName = (String)session.getAttribute("traderName");
    String strPassword = (String)session.getAttribute("password");
    String strIDNum = request.getParameter("auctionID");
    Integer intID = Integer.valueOf(strIDNum);
    Integer [] bids = aHse.getAllBids(intID);
    float fltYourBid = aHse.getBidPrice(bids.length);
    ^
    Can't convert int to java.lang.Integer.
    can anyone help please?

    So, does "aHse.getBidPrice" expect an int or an Integer as its parameter? And does it return an int, or an Integer, or what? The answer to those questions may lead to your solution -- look at what you are actually using as the parameter, for example.

  • Can't convert int to java.lang.Object

    When I deploy my customer Bean, the following error occures, I think the main problem is Can't convert int to java.lang.Object, does anyone facing the same problem with me?
    <pre>C:\j2sdkee1.3\repository\home\gnrtrTMP\CustomerApp\CustomerBean_RemoteHomeImpl.j
    ava:27: Incompatible type for declaration. Can't convert int to java.lang.Object
    java.lang.Object primaryKey = ejb.ejbCreate(param0, param1, para
    m2);
    ^
    C:\j2sdkee1.3\repository\home\gnrtrTMP\CustomerApp\CustomerBean_RemoteHomeImpl.j
    ava:57: Incompatible type for =. Can't convert int to java.lang.Object.
    primaryKeys = ejb.ejbFindByPrimaryKey( param0);
    ^</pre>
    I really need your help!!!

    you can only convert one object type to another. Integer is an object int isnt. You might want to convert int to Integer and then go ahead.
    see if it works.

  • Cant convert boolean to java.lang.Boolean - HUH?

    I'm fairly new to Java, but I'm pretty sure this should work.
    Can someone tell me why I'm getting these compiler errors:
    wehServlet.java:72: Incompatible type for if. Can't convert java.lang.Boolean to boolean.
    if (checkoutSpecificFile(req,res,busId,tempDir)) {
    ^
    wehServlet.java:123: Incompatible type for return. Can't convert boolean to java.lang.Boolean.
    return true;
    Here's the basic code:
    import java.io.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.util.*;
    public class wehServlet extends HttpServlet {
    private void someThing (HttpServletRequest req, HttpServletResponse res)
    throws ServletException, IOException {
    if(tryThis()) {
    <do something>
    } else {
    <do something else>
    private Boolean tryThis() {
    return false;
    Why can't I do this?
    How do I fix it?
    I tried
    if(tryThis().booleanValue())....
    and I get this compile error:
    Incompatible type for return. Can't convert boolean to java.lang.Boolean
    Now what do I do?

    There's a lot of confusion caused by these "Wrapper" objects, not just Boolean but Integer, Long etc.
    The basic ("primitive") types are lower case names, boolean, int, long etc..
    The related items with capital letters are "wrapper" objects. The are used in a context where you basically want to store a single value but must do so as an Object, for example in aggregate objects like Map or List.
    You should avoid these unless there's a specific reason to use them.
    You can convert between boolean and Boolean, int and Integer etc. but it has to be done explicitly. As far as Java is concerned they're entirely different kind of thing. To java the Boolean class is just another kind of Object, it has no special syntactic significance.
    boolean b;
    Boolean bo;
    b = bo.booleanValue();  // covert from Boolean object to boolean primitive
    bo = new Boolean(b); // convert primitive to Object
    if(bo.booleanValue()) {  // test Boolean objed

  • How can I convert an image created in Photoshop into a format that Java's ImageIO library will take?

    Hi all,
    I've been trying to write an image resize tool to use the Lancoz resample algorithm to resize images to a high standard in Java.  The library with the algorithm/filter in it is mortennobel's image scaling library and it takes a buffered image as an input and returns the resized image as desired.  However the trouble I’m having is that the ImageIO library in Java, a standard library, which converts images given to its read method to buffered images doesn't accept certain images created in Photoshop and so it throws an exception.  My library needs to be fully automated to process possible thousands of images at a time and so manually converting them by resaving them as JPEG's is really feasibly.  Is there some way I can convert these images from Adobes Exif format to standard JFIF format?  I've tried simple inserting the APP0 marker from a JFIF image in-between the SOI and APP1 marker but the ImageIO library still failed.
    The above image is a screenshot of the binary in hex of one of the images that cause an Invalid Format exception when passed to ImageIO.
    Any help you could offer me with this would be much appreciated.
    Kind regards and thank you,
    Alexei Blue
    Science Warehouse.
    NB: I previously posted this post in Developers but was told to post it in a Photoshop forum so apologies if this is the incorrect formum

    The image scaling library does have a BiCubicFilter in it so I'll experiment around with them and see what happens.  As for the imageIO library I think it accepts Exif image types, but still for some reason it just doesn't like Adobe Photoshop types.  Maybe its the colour map it doesn't like I just can't seem to work out what's wrong which is slightly frustrating but looking round to see if I can find an answer

  • Can anyone convert this code to java......(urgent)

    hi everybody.....
    can anybody provide me a java code for the following problem......
    i want that if user enters input like this:
    sam,john,undertaker,rock
    the output should be:
    'sam','john','undertaker','rock'
    i.e , is converted to ',' and the string starts with ' and ends with '
    i have a javascript code for this and it is reproduced below to have full view of the problem.........
    <HTML>
    <BODY>
    <script type="text/javascript">
    function CONVERT(){
    var re=/[,]/g
    for (i=0; i<arguments.length; i++)
    arguments.value="'" + arguments[i].value.replace(re, function(m){return replacechar(m)}) + "'"
    function replacechar(match){
    if (match==",")
    return "','"
    </script>
    <form>
    <textarea name="data1" style="width: 400px; height: 100px" ></textarea>
    <input type="button" value="submit" name="button" onclick="CONVERT(this.form.data1)">
    </form>
    </BODY>
    </HTML>
    can anyone do it for me.
    thx in anticipation

    Sunish,
    On your problem, check in the String class documentation the method replaceAll(), you can solve your problem in just one line of code.
    As for why the serious poster(the ones that are here to help, for many year, instead of just disrupting the forum) do not give you code is that they are here to help people learning and not to give free code.
    You help a person to learn, when you provide this person with the tools to research and help the person to think out of his problem, so that in the future the learning person can repeat the process by herself instead of going after finnished solution everytime he needs it.
    May the code be with you.

  • I am in the process of doing a Proof Of Concept / Evaluating products that can help us build a Java Application to Convert a PDF document to a Searchable PDF.   I wanted to check is there any simple JAVA API from Adobe to achive this ? Any direction in th

    I am in the process of doing a Proof Of Concept / Evaluating products that can help us build a Java Application to Convert a PDF document to a Searchable PDF. 
    I wanted to check is there any simple JAVA API from Adobe to achive this ? Any direction in this regard is greatly appreciated.@

    You can achieve this using LiveCycle PDF Generator JAVA API. You can find required code here:
    Adobe LiveCycle * Quick Start (SOAP mode): Converting a Microsoft Word document to a PDF document using the Java API
    In parameters:
    //Set createPDF2 parameter values
    String adobePDFSettings = "Standard";
    String securitySettings = "No Security";
    String fileTypeSettings = "Standard OCR";
    "Standard OCR" file type setting will run OCR on input pdf. In the code, instead of doc file provide a pdf file. Resultant pdf will be searchable PDF i.e OCRed PDF.
    Feel feel to ask any further questions.

  • I have just download a book from itunes store but, i don't have an iPad to read it. Can anybody help me? Can i convert it? Thanks.

    i have just download a book from itunes store but, since i don't have an iPad, i can´t read it or even see it. Can anybody help me? Can i convert it? Thanks.

    Every purchase page for an ebook has a section that says "Requirements".  What does that say for your particular book?  That should give you the answer to your question.  Conversion is normally not possible.
    But there are some exceptions.  Please provide the Title of the book if you want further help.

  • How can I convert output data (string?) from GPIB-read to an 1D array?

    Hello all,
    I am reading a displayed waveform from my Tektronix Oscilloscope (TDS3032) via the GPIB Read VI. The format of the waveform data is: positive integer data-point representation with the most significant byte transferred first (2 bytes per data point).
    The output data of GPIB-Read looks like a string(?) where the integer numbers and a sign like the euro-currency sign are seperated by spaces e.g. #5200004C3 4 4 4 4 3C3C3........ (C represents the euro-currency sign).
    How can I convert this waveform data into a 1D/2D array of real double floatingpoint numbers (DBL) so I can handle the waveform data for data-analysis?
    It would be very nice if someone know the solution for this.
    t
    hanks

    Hi,
    First of all, I'm assuming you are using LabVIEW.
    The first you need to do is parse the string returned by the instrument. In this case you need to search for the known symbols in the string (like the euro sign) and chop the string to get the numeric strings. Here are some examples on parsing from www.ni.com:
    Keyword Search: parsing
    Once you parse the numeric strings you can use the "String/number conversion VIs" in the String pallette.
    Hope this helps.
    DiegoF.Message Edited by Molly K on 02-18-2005 11:01 PM

  • How did my pdf files get converted from 'open with Adobe Reader' to open with Adobe Acobat'?  And if I have a ''free'' Acrobat account why does it not open?  When I do click on the account it ask me to pay $89.99.  I never wanted Acrobat.  How can I get -

    How did my stored files get converted from 'open with Adobe READER' to 'open with Adobe ACROBAT'? How can I get them re-set to open with 'Adobe Reader'?
    Please reply to my e-mail:   [email protected]

    It sounds as if you downloaded Adobe Acrobat Pro. If you did, uninstall it. Then repair Adobe Reader.
    The free Acrobat account has no connection to any of this.

  • How can I convert .pdf file to .doc using the free adobe reader app? when I try to convert the .pdf file it asks me to sign in. when I click on "sign in", I am taken to a service subscription page. So, no free conversions using free adobe reader app?

    how can I convert .pdf file to .doc using the free adobe reader app? when I try to convert the .pdf file it asks me to sign in. when I click on "sign in", I am taken to a service subscription page. So, no free conversions using free adobe reader app?

    As has been mentioned Adobe Reader cannot export PDF page content. Nor can it create PDF or manipulate PDF page content.
    What you can do is use one of Adobe's online subscription services. Two provide for PDF  to Word export.
    There's ExportPDF and PDF Pack.
    Be well...

  • Can Berkeley DB Java Edition read BDB created with C

    Hi,
    If I use C to create a BDB database and store the values. Can I use Berkeley DB Java Edition to open and read the content? I am trying to do search and reversed order display and it seems like only DB java Edition has that feature.
    Is that correct?
    Thanks for all your help and suggestion.
    juan

    Hello,
    You will not be able to do that. BDB Java Edition and Berkeley DB are not the same product.
    Thanks,
    Sandra

  • How can I convert/read out from a string Hex (8-bit), the bit 0 length 1

    How can I convert/read out from Hex (8-bit), the bit 0 length 1 (string subset!!??) and convert it to decimal.
    With respect to one complement and two complement ?

    Just like Jeff, purely guessing here.
    It almost sounds like you just need to Read from Binary File?
    AND the 8-bit number with 1?
    Need more details.  What exactly do you have to start with?  What exactly are you trying to get out of it?  Examples help.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

  • I do not have Microsoft office and to know if I can still open docx files - error message reads corrupt files.  Is there a reliable converter out there?

    I do not have Microsoft office and want to know if I can still open docx files - error message reads corrupt files.  Is there a reliable converter out there?  I am a new mac user.

    Install the free LibreOffice and save a bundle not having to pay MS. http://www.libreoffice.org/

  • How can I convert an Image ( or BufferedImage ) to Base64 format ?

    Hi folks...
    How can I convert an Image, or BufferedImage, to the Base64 format ?
    The image that I want to convert, I get from the webCam connected to the computer...
    Anyone can help me ?
    Rodrigo Kerkhoff

    I suggest you read this thread concerning this:
    http://forum.java.sun.com/thread.jspa?forumID=31&threadID=477461
    Failing that, Google is your friend.
    Good luck!

Maybe you are looking for