Opening dans Reading Files

Hi i have a question
want to open 2 data files
and then i want to compare them by reading 4 bytes at the time
this is how i open the files
from one class i call a method from another class like this
file2Read = new File2Read(file1)
file2Read2 = new File2Read(file2)
in my File2Read class i have a method that opens a new file like this
file = new DataInputStream( new BufferedInputStream( new FileInputStream(file)));
my problem is when i try to compare de data i have the same output for 2 different files
when it should be different
Could somebody help me with that thank you

what do you mean by don't declare it static
and this is the code in my first class to open the files
public void openFirstFile(){
     try {
          firstFile = new File2Read(file);
     } catch (FileNotFoundException e) {
          // TODO Auto-generated catch block
          e.printStackTrace();
public void openSecondFile(){
     try {
          secondFile= new File2Read(file);
     } catch (FileNotFoundException e) {
          // TODO Auto-generated catch block
          e.printStackTrace();
}this is the code in my class file2Read
public file2Read(String file) throws FileNotFoundException {
     try {
          /* open the handler on the specified file */
          file2read = new DataInputStream(
                         new BufferedInputStream(
                         new FileInputStream(file)));
     } catch (FileNotFoundException e) {
          /* the path is not valid */
          throw e;
}any one knows what could be the problem in there
thank you

Similar Messages

  • How to open adobe reader file in adobe pro xl?

    how to open adobe reader file in adobe pro xl?Downloading, Installing, Setting Up

    Moving this discussion to the Acrobat Installation & Update Issues forum.

  • How to open Adobe Reader file from another native IOS application?

    There is an existing thread, but I want to re-open it because I think this is an important feature that we need badly.  I was wondering if there is any plan to add this feature so we can open PDFs directly into Adobe from the web / other apps.
    How to open Adobe Reader file from another native IOS application?
    Basically, we just want to use a custom URL scheme to open a specific document in the App.  Currently, this only opens the app but does not load the file.
    APB

    Not to hijack the conversation but I can explain why this would be useful for both the above case and another.
    What I believe Pavel is talking about is setting up a "URL Scheme" for the Adobe Acrobat iOS application so that you can easily open a PDF specifically in Adobe Acrobat iOS from other native applications and even from web applications opened within Safari. This is particularly useful if your application requires some of the specific features in Adobe Reader iOS to grant them the best experience possible and you want to encourage this.
    Another case: If you're using Adobe Livecycle's document security modules (that encrypts PDF files so that Adobe Acrobat must "phone home" to decrypt and view the document), these PDF's can only be viewed inside the Adobe Acrobat application and appear as blank in most other PDF readers. Having a URL scheme allows your application utilising this functionality to have a 1 click step to view the PDF rather than the current non-user friendly process:
    - Within Safari, touch the PDF link (appears as blank in the default Safari PDF reader, which in itself is confusing)
      - Touch "Open in..."
      - Touch "Adobe Acrobat"
    We have an immediate need for this functionality for the example above. I can resubmit it in a separate post if necessary.

  • Cannot open adobe reader files.....because it was not a supported type file.......

    Cannot open adobe reader file............could not open because it was not a supported type file...........or damaged by email.... What support does it need????

    Impossible to say. All we can know is that it is NOT a valid PDF file.
    You could take a look. Try this.
    1. Open the file in Microsoft Word (or NotePad).
    2. If the file is good, use it - it was a Word (or text) file.
    3. Otherwise, look at the first few lines. These will probably be gobbledegook.
    4. Copy and paste the first few lines into your reply, perhaps someone will recognise what the file really is.

  • Open adobe reader file - read option - instead of open

      When I try to open a adobe reader file by right clicking it I get " read" instead of "open " file.
    please see attached file for an example of what I mean.
    In the attahed printed screen file it says open - this is OK.
    but in my other pc I have only "read" not open.
    your help would be appreciated
    Thanks
    Omer

    If I press Read the file opens OK with no problem.
    The problem is that if I try to open the same file from a third party program it does not open .
    The file looks like it does know what windows extension it is supposed to be.
    I will try to post a screen shot from the other PC
    thanks

  • Opening Multiple Reader Files Stacked and Aligned

    I know it's a strange request but...
    A coworker of mine is wanting all of the Reader files that she opens to have each Reader window aligned and stacked on each other instead of them cascading or randomly arranged. These are all the same size documents and the layout is the same but just different content for each.
    I have tried changing the preferences under Open Settings in "Documents" to "check Restore last view settings when reopening documents". But it isn't working.
    Anyone else require this or know how to make this happen?
    Jim

    I don't believe you have any control over this.

  • I cannot open any reader files after installing reader XI

    why can't I open files.  I can't even open the program, but it won't let me uninstall saying I have files open.

    What is your operating system?  What is your Reader XI version?  What exactly means "cannot"?

  • Can't open or read my Z10 backup files

    I was using and loving my Z10 had a ton of info on it. so I cept it backed up, all great right.
    I thought so, its backed up all is good. well after a wile my phone started breaking down, so
    I took it in to get fixed. they said it was toast and no good anymore. so phone in the garbage, went
    to get new Z10 phone. there was no more avalaible so got S4. went home to open my backup file to
    put info on new S4 and i can't do it. so then I tried opening the backup file so I can read my info and work
    with it that way. I can not for nothing figure out how to open or read files. Please Help!!!

    The backup file is on able to restore to another BlackBerry10 device. Sorry.
    1. If any post helps you please click the below the post(s) that helped you.
    2. Please resolve your thread by marking the post "Solution?" which solved it for you!
    3. Install free BlackBerry Protect today for backups of contacts and data.
    4. Guide to Unlocking your BlackBerry & Unlock Codes
    Join our BBM Channels (Beta)
    BlackBerry Support Forums Channel
    PIN: C0001B7B4   Display/Scan Bar Code
    Knowledge Base Updates
    PIN: C0005A9AA   Display/Scan Bar Code

  • Reports server Cannot read files from mapped drive

    Hi,
    Am trying to run a report from a network mapped drive under WinNT 4.0 through report server.
    I get "REP-0110 Error opening or reading file" error message. After looking up the help on error, I find:
    1. The file being accessed does exist
    2. The login account has full privileges
    with the file/directory/drive in question.
    If the report to be run is on a local drive,
    everything is fine.
    Can anyone help me asap.
    Thank you
    Sundar
    null

    hello,
    there are multiple things to keep in mind :
    1) if you are using a mapped drive :
    mapped drives are on a per-user-basis. the reports-server-service is running as a system-service by default and will not have the same mapped drives as the logged on user. in fact it fill have NO drives mapped.
    what you could do is to use the UNC-path like \\servername\share\filename to adress the file
    2) problems with UNC
    there are some known problems using UNC to access files on remote machines in some versions of reports. pls check with oracle support services in case this causes problems.
    regards,
    the oracle reports team

  • SP2013 and Project 2013 - project files open in read-only mode with no options to edit only Save As

    Hi all,
    Environment:
    SharePoint 2013 (15.0.4420.1017)  RTM
    Windows 8 - Project 2013 (15.0.4433.1506) 32Bit
    Issue details:
    When opening .mpp files stored within SharePoint they are opened successfully within Project 2013 however they are opened in Read-Only mode with no options to edit/check out only Save As.  The
    same outcome is experienced if you click the document link within SharePoint or you chose to edit from the document menu. 
    Opening the file through windows explorer also opens only in read-only mode.
    To date we’ve tested the following
    Windows 7 – Office 2010 = working as expected
    Windows 8 – Office 2010 = working as expected
    Windows 7 – Office 2013 = opening as read only, no prompt to edit
    Windows 8 – Office 2013 – opening as read only, no prompt to edit
    Current thinking is that it is an issue with either the SharePoint Office Documents Class ActiveX control or Project 2013 itself interacting with SharePoint 2013.
    We have tested this in multiple SP2013 environments with the same outcomes.
    The workaround therefore is to save locally and then upload again which is not ideal.
    Unable to find an exact issue match to this.
    Any help with this appreciated.

    Hi Dan,
    For us after investigating this further it was found that using the document menu to edit or checkout and then edit results in the project file being opened in read-only mode. 
    The same issue was present for Visio files.
    Using the FILES ribbon menu results in the document being opened in edit mode successfully in both Project and Visio.
    Please note that we found that this issue only exists within document libraries where checkout is required to edit which was our case.  If checkout is not required the document
    menu can also be used as expected.
    Cheers,
    Dan

  • Generally when creating a Word file from either a Mac or Win7 pc and opening it on two different machines (either one first) it always prompts that the file is open and will be opened as read only. However opening a CSS file does not prompt that it is alr

    Generally when creating a Word file from either a Mac or Win7 pc and opening it on two different machines (either one first) it always prompts that the file is open and will be opened as read only.
    However opening a CSS file does not prompt that it is already open on or from any machine which is causing code edits to be lost.
    What we found from out testing:
    - The file can be saved from one user to the server and WILL NOT PROMPT on other machines until the saving machine has the Dreamweaver program closed completely
    - The file can be closed and  Dreamweaver minimised to the launch bar but it still will not register on other machines that it has been changed.
    - Also, until the  Dreamweaver program is closed on the machines, it will continue to open it's saved version of the file. 
    Example Scenario:
    - User 1 opens test.css (which is 2000 lines) and adds some code to the end of the file to bring it up to 2500 lines
    - Meanwhile User 2 opens test.css as well (opens as 2000 lines as User 1’s edits have not yet been saved) and adds in code to bring it to 2300 lines
    - User 1 saves his file and closes it - but  Dreamweaver is still open.
    - User 2 also saves his file and leaves  Dreamweaver  open.
    - The server will report the size and last edit of the file the same as User 2 as he was the last person to save it (and if you open from the Win7 Machine it will show as User 2’s 2300 line version)
    - If User 1 then open's the file again (from either the 'recent' in Dreamweaver OR clicking on the file directly in Finder...which version opens.... The version that User 1 saved! Not the true version on the server, but the version that User 1 edited and saved with 2500 lines in it.
    - Same for User 2, he will open 'his' version with 2300 lines in.
    Other information:
    - Files are opened directly from the server
    - Sometimes the users will save incrementally and re-open
    - Most of the time users will save incrementally and keep the files open
    - The users will never not save incrementally and just save when closing the file once finished
    - The users are usually working on the files all day
    - It is always the bottom lines of code that are lost. It could be a case of the two versions being mixed up and cutting off the newly added lines based on the line count (possibly).
    It is as if Dreamweaver is holding a cache of the version locally and then only properly looking back to the server when it has been completely closed. It is very difficult to see how the server is causing such an impact on these files, there are very few logs which are giving any indication to the root cause of the problems.
    Anyone know if this is a known issue?
    Is there a way that there can be a featured implemented on the server that doesn't allow another user to open a file if it is already open on another machine?
    Thanks

    Your server file handling has nothing, and really nothing to do with Adobe software. If files don't get locked for (over-)writing and/or lose connection to the program opening them, then your server is misconfigured. It's as plain and simple and that. Anything from "known file types"/ file associations not being set correctly, MIME types being botched, crooked user privileges and file permissions, missing Mac server extensions, delayed file writing on the server, generic network timeout issues and what have you. Either way, you have written a longwinded post with no real value since you haven't bothered to provide any proper technical info, most notably about the alleged server. Either way, the only way you can "fix" it is by straightening out your server and network configuration, not some magic switch in Adobe's software.
    Mylenium

  • Open and read from text file into a text box for Windows Store

    I wish to open and read from a text file into a text box in C# for the Windows Store using VS Express 2012 for Windows 8.
    Can anyone point me to sample code and tutorials specifically for Windows Store using C#.
    Is it possible to add a Text file in Windows Store. This option only seems to be available in Visual C#.
    Thanks
    Wendel

    This is a simple sample for Read/Load Text file from IsolateStorage and Read file from InstalledLocation (this folder only can be read)
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;
    using Windows.Storage;
    using System.IO;
    namespace TextFileDemo
    public class TextFileHelper
    async public static Task<bool> SaveTextFileToIsolateStorageAsync(string filename, string data)
    byte[] fileBytes = System.Text.Encoding.UTF8.GetBytes(data);
    StorageFolder local = Windows.Storage.ApplicationData.Current.LocalFolder;
    var file = await local.CreateFileAsync(filename, CreationCollisionOption.ReplaceExisting);
    try
    using (var s = await file.OpenStreamForWriteAsync())
    s.Write(fileBytes, 0, fileBytes.Length);
    return true;
    catch
    return false;
    async public static Task<string> LoadTextFileFormIsolateStorageAsync(string filename)
    StorageFolder local = Windows.Storage.ApplicationData.Current.LocalFolder;
    string returnvalue = string.Empty;
    try
    var file = await local.OpenStreamForReadAsync(filename);
    using (StreamReader streamReader = new StreamReader(file))
    returnvalue = streamReader.ReadToEnd();
    catch (Exception ex)
    // do somthing when exception
    return returnvalue;
    async public static Task<string> LoadTextFileFormInstalledLocationAsync(string filename)
    StorageFolder local = Windows.ApplicationModel.Package.Current.InstalledLocation;
    string returnvalue = string.Empty;
    try
    var file = await local.OpenStreamForReadAsync(filename);
    using (StreamReader streamReader = new StreamReader(file))
    returnvalue = streamReader.ReadToEnd();
    catch (Exception ex)
    // do somthing when exception
    return returnvalue;
    show how to use it as below
    async private void Button_Click(object sender, RoutedEventArgs e)
    string txt =await TextFileHelper.LoadTextFileFormInstalledLocationAsync("TextFile1.txt");
    Debug.WriteLine(txt);
    在現實生活中,你和誰在一起的確很重要,甚至能改變你的成長軌跡,決定你的人生成敗。 和什麼樣的人在一起,就會有什麼樣的人生。 和勤奮的人在一起,你不會懶惰; 和積極的人在一起,你不會消沈; 與智者同行,你會不同凡響; 與高人為伍,你能登上巔峰。

  • I cannot open this PDF file in Acrobat 8 Pro or in Acrobat Reader on Windows 7 64-bit

    I have a PDF file that I could open on my Windows XP 32-bit laptop in Acrobat 8 Pro or in Acrobat Reader.  I then upgraded to a Windows 7 64-bit laptop.  But now in Win7-64, I cannot open this same file using the same apps (Acrobat 8 Pro & Acrobat Reader XI). 
    When I try to open it in Acrobat 8, it does not load and instead a popup windows appears saying -
    Adobe Updater
    Some components needed to complete this operation are missing but information about them may be available on the Adobe website. Would you like to search the Adobe website for the missing components? 
    And I can choose either the OK or Quit buttons.  When I click OK, a web browser starts and goes to this website -
    http://www.adobe.com/special/adobe_update_manager/?type=Filter&name=FOPN_foweb&version=0.0 .0.0&lang=en_US&os=Windows&osver=6.1.7601&appid=acrobat8pro-en_US&cpu=intel
    This webpage says -
    Adobe Update Manager
    Adobe cannot locate the requested plugin. New plugins will be listed on this page. Currently there are no plugins.
    So now I am stuck, no direction to go.  I am left without any solution from Adobe for Acrobat on this file.
    When I try to open this PDF file in Reader, it does not load and instead a web browser is spawned loading the webpage -
    http://plugin.fileopen.com/Default.aspx?bhcp=1
    This is the FileOpen Plug-in for Adobe Acrobat/Reader, which prompts to -
    Please click OK to download the FileOpen Plug-in Installer for Adobe Acrobat/Reader 
    I click on OK, download and run the Installer file, accept the terms, and installed the FileOpen Client (x64) B928.  Upon completion, it prompts to Finish.  But it does not automatically bring Reader up or try to load the file.  So I try again to load the PDF file into Reader.  But once again, the file does not load and the web browser is spawned loading the same FileOpen Plug-in Installer link.  I click OK again, and start the same FileOpen Client process.  This time, it recognizes that I have FileOpen Client installed, and the window gives me two choices, Repair or Remove.  So since I apparently need this Plug-in, I choose Repair.  The process seems to complete the Repair.  But when I try to load the file, it still brings me back to the FileOpen Plug-in webpage.  So now I am stuck again, and left without any solution from Adobe for Reader on this file. 
    I tried Adobe support.  But apparently Adobe does not support past releases of their products (Acrobat 8), and also does not give free support for the current version of their free products (Reader XI). 
    Can this be fixed? 

    How is Acrobat 8 not fully Windows 7 compatible?  I see discussions on this Adobe Community saying how Acrobat 8 does work on Windows 7 and with 64-bit.  It appears that if Acrobat 8 is updated to the latest version, then this should fix AA8-Win7 issues.  And I am at the latest AA8 version, 8.3.1. 
    And how are Acrobat 8 and Reader XI are not compatible?  I have always had Acrobat and Reader installed on the same PC, without ever having any issues.  And Adobe allows the installation of one after the other.  So apparently Adobe allows them both to exist together.  If they are incompatible, then why would Adobe allow them to exist together? 
    Anyway, I did uninstall the FileOpen Plug-in and the Reader XI, then reinstalled the FileOpen Plug-in.  So now Reader is not installed and only Acrobat 8 is installed.  I then tried to load the PDF file, but I still get the Acrobat 8 error described above. 

  • I cannot open a pdf file with aole-mail. I can open pdf files from windows explorer. I have associated pdf with adobe reader. My operating system is window

    I cannot open a pdf file with aol e-mail. I went to preferences in Adobe Reader but did not know what to enter for Incoming IMAP and outgoing SMTP. I can open pdf files from windows explorer as  I have associated .pdf files with adobe reader. My operating system is windows 7.
    When I try to open the pdf file within aol e-mail I get a message: 'Your security settings do not allow this file to be downloaded'.  I have not changed my security settings (Tools, Internet Options, security).

    Or http://helpx.adobe.com/acrobat/kb/pdf-browser-plugin-configuration.html

  • When I try open a .pdf file my Adobe Reader 11 only allows the download / save opening the related window and don't show me both options 1) open with ... and 2) save as.... probably someone flagged the choise... always perform this way ....

    When I try open a .pdf file my Adobe Reader 11 only allows the download / save opening the related window and don't show me both options 1) open with ... and 2) save as.... probably someone flagged the choise... always perform this way ....
    Could some one give help and let me know where I can probably find the settings option that allows me to change and switch to previous situation where it was possible to decide time to time how to proceed either opening the file or saving it ??
    Thanks in advance
    David

    What is your operating system?
    Open a PDF from where?  If online, in what browser?

Maybe you are looking for