Read bytecode of a PDF file

Hello
I must read Bytecode of a .PDF file but the method I use is too slow.
Is there anybody can suggest me a faster or better method, please?
This is my code
public String scriviBC (String strPercorso, String strFile) {
binario = "";
try {
File file = new File (strPercorso + strFile);
int i;
InputStream input = new FileInputStream(file);
BufferedInputStream in = new BufferedInputStream(input);
BufferedReader reader = new BufferedReader(new InputStreamReader(in));
while ((i = reader.read()) != -1) {
binario += i;
risultato = binario;
System.out.println(binario);
} // END try
catch(Exception e) {
System.out.println("error"); e.printStackTrace();
risultato = e.toString();
} finally {
return risultato;
Ps I've already tried without buffering but it's the same.
Excuse me for my bad english and thank you!

Use Code Tags
The reasons this is slow is:
1) reading a single byte at a time (reader.read())
2) creating a new string each loop (for each char).
To speed it up, you want to use the read method that takes an array, and read multiply letters at a time, and use a StringBuffer.
Also are you doing what you want to do?
For a start you say "Bytecode of a .PDF", but then you are reading using a "BufferedReader" which is for textual data, when a PDF is bytes (and so you should be using a Stream, not a Reader).
Then you creating a long string of this (as understand the code, as a string of numbers like "1231878394794237", which would be not be useable), for bytes, would'nt a byte array or alike be a better option?

Similar Messages

  • Can I obtain a CD-ROM with the latest revision of Adobe Reader for a Windows XP system w/ Service Pack 3. I do not want to go online with this system. I have dedicated it to read all of my PDF Files only.

    I have 4 computer systems, 2 of which run under Windows XP w/ Service Pack 3. I have dedicated these systems to the task of reading all of my PDF Files which I have collected from my recent college career. The desktop system I want to use is an old Dell Optiplex GX240 with Acrobat Reader 4.0. The other Windows XP system I have is an old HP Laptop with Adobe Reader 8.1.4 installed. I want to update both systems to the latest version that is available for Windows XP w/Service Pack 3 installed. So, because I do not want to place these system online, would it be possible for me to obtain a copy of the Adobe Reader software I need on a CD-ROM? - Ken DeWitt, a 68-Year-Young Vietnam Veteran and recent college graduate...Summa Cum Laude.

    You can use an in-line computer to download the full offline Reader installer from
    http://get.adobe.com/reader/enterprise/

  • How can I hide page thumbnails navigation bar at the start up of Adobe Reader and open a pdf file?

    How can I hide page thumbnails navigation bar at the start up of Adobe Reader and open a pdf file? I could not find this option under Preferences tab? Thanks

    Hey there,
    Thanks for your reply. That works for the files I do what you said. However, for files I have not done that, It still shows the navigation bar. Any idea, how to do it default for any files?
    Thanks agian

  • Adobe reader will not open pdf files I have saved as, or, export as pdf to my desktop (latest Maverick). The same file does open when I am on the source website (i.e. user manuals etc.). Why?

    Adobe reader will not open pdf files I have saved as, or, export as pdf to my desktop (latest Maverick). The same file does open when I am on the source website (i.e. user manuals etc.). Why?

    iMac G4, Mac OS X (10.4.9)
    Make sure you have the latest Adobe Reader installed for your OS.
    http://www.adobe.com/support/downloads/product.jsp?platform=macintosh&product=10
    Did you try using Preview. If you control click on the PDF on your desktop you can use the "open with" option.

  • Programming help - how to get the read-only state of PDF file is windows explorer preview is ON?

    Programming help - how to get the read-only state of PDF file is windows explorer preview is ON?
    I'm developing an application where a file is need to be saved as pdf. But, if there is already a pdf file with same name in the specified directory, I wish to overwrite it. And in the overwrite case, read-only files should not be overwritten. If the duplicate(old) file is opened in windows (Win7) explorer preview, it is write protected. So, it should not be overwritten. I tried to get the '
    FILE_ATTRIBUTE_READONLY' using MS API 'GetFileAttributes', but it didn't succeed. How Adobe marks the file as read-only for preview? Do I need to check some other attribute of the file?
    Thanks!

    Divya - I have done it in the past following these documents. Please read it and try it it will work.
    Please read it in the following order since both are a continuation documents for the same purpose (it also contains how to change colors of row dynamically but I didnt do that part I just did the read_only part as your requirement) 
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/f0625002-596c-2b10-46af-91cb31b71393
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/d0155eb5-b6ce-2b10-3195-d9704982d69b?quicklink=index&overridelayout=true
    thanks!
    Jason PV

  • Read the text in pdf file

    Dear all,
    I have checked a lot of post about reading pdf in this forum. However, is it possible to read the text in pdf file. In my case, I need to read the content of pdf to do further process. Could anybody give me some suggestions. Thank you.

    I have a similar problem, can anybody help us....

  • Adobe Reader doesn't open .pdf files anymore. Error: 213:11.

    Adobe Reader doesn't open .pdf files anymore. It's written Error: 213:11. Details: laptop with Windows XP, Adobe Reader X

    Are these local or online documents?  If online, in what browser?  If local, does the documents folder and docs themselves have sufficient permissions?
    Is there anything else beside the number 213:11?

  • Cannot open Adobe Reader XI or any PDF file

    When I try to open Adobe Reader XI or any PDF file, it says that it "cannot open in Protected Mode due to an incompatibility with your system configuration. Would you like to open Adobe Reader with Protected Mode disabled?"  When I choose open with Protected Mode disabled, it then displays "Acrobat failed to load its Core DLL.” Please help. Thank you. All PDF’s and adobe reader use to work on my computer. Thank you.  When I try troubleshooting the problem, “incompatible application” is listed under the troubleshooting report.

    Hi
    Please follow this KB doc: http://helpx.adobe.com/acrobat/kb/reader-core-dll-error.html
    Thanks

  • Does Reader for iPad store PDF files for viewing later when offline?

    Does Reader for iPad store PDF files for viewing later when offline?
    I'm asking because I have my portfolio as a PDF and I want to take my iPad with me to interviews, where I won't have Internet access, to show my portfolio.
    Cheers,
    Matt.

    Awesome, I had hoped adobe were on the ball with this, but it's worth finding out beforehand.
    Thanks!

  • Reader will not load pdf files

    my adobe reader will not load pdf files. I tried un-installing and re-downloading the reader. same thing it won't work. It works on my other computer

    The operating system is Windows 7. I get error message "there is no email program to perform the requested action". I get same error for local C: drive, jump drive, online firefox or microsoft browser. same problem.
    I fixed the problem by un-installing adobe xi and re-downloading adobe x. Its working great. adobe xi may work OK on windows 8. I have a laptop with Windows 8. I will be trying that tomorrow. I will send you a message.
    Lightman6770

  • Can I read and search a PDF file on my IPAD

    Can I read and search a PDF file on my IPAD??

    Several apps will allow you to work with PDFs. iBooks will handle them, but there have been a few issues reported about using it for that purpose. My guess is it depends on the size and complexity of the file. Adobe has a reader in teh app store (free). Goodreader is an option, and provides functionality for searches.

  • I DL ver 9,10,11 of Free Adobe Reader - cannot open any PDF file.

    I get an error message "The instructions at xxxx referenced memory at xxxx. The memory could not be written." What is wrong?

    tI did as you instructed and got no good results. I even restored my Adobe files from several weeks ago from Carbonite and could not load Adobe REader nor open any PDF file that I was previously able to open.
    When I try to open a PDF file, I get a web page that has two panes. One pane on the left has a red box area with some options. The pane on the right is grey and has some options. The web page disappears after about 5 seconds so I can't read it all.
    I tried opening three files after reinstalling Adobe Reader and after restoring my Adobe files. One folder that I restored as "Cache" and had a file inside called "AcrobatFnt11 then another file called AdobeCMapFnt11 and the other file called AdobeSysFnt11.
    I'm extremely anxious to be able to open and load all my PDF files like I was able to for years before.
    Thank you.
    [spam links removed again!]

  • Does Acrobat Pro read the content in pdf file and transforms it?

    Does Acrobat Pro read the content in pdf file and transforms it to xls file without the need for much changes or manual work?

    Acrobat X (Standard and Pro) will save tabular data to XLS or XLSX format, provided it can recognize the table as being a table. If the PDF has missing or incorrect structure tags, Acrobat will try to guess the table layout by the position of text and lines on the page - this works well for basic formatting but if the table has complex styling, spanned cells etc. it can lead to problems.
    Acrobat X will even attempt to export a table within a scanned document, by applying OCR during the export stage - though again this relies on the table being visually identified.
    See http://www.adobe.com/products/acrobatpro/pdf-to-word-excel-converter.html and this article on how to extract one table from a larger document.

  • How to read,dispaly and open pdf files

    Hi, I am very new to Java butI have VB6.0 background. My current requirement is to read pdf file names from a directory, then
    show them on a form in a list (with their path in background pointing to the actual pdf files) and then once a user clicks any
    file name, open that file on the form.
    For example:
    My pdf files are in a directory as following:
    C:\myreports\user1\
    report1.pdf
    report2.pdf
    report3.pdf
    C:\myreports\user2\
    report1.pdf
    report5.pdf
    The output on the form should look like this if user1 has logged in the system. Side note: I am able to get userid of the logged in person in a variable.
    My Reports:
    . Report 1
    . Report 2
    . Report 3
    When a user clicks Report 1, it opens on the same form in pdf format.
    Thanks
    S.yhong

    For the first part (Listing thepdf files in the directory) you can use the java.lang.File class.
    File f = new File("path to your directory");
    File files[] = f.listFiles();
    then process the files array to find the files with extenction pdf
    You can also use a file filter object and make the listFiles method return only the pdf files.
    Please read the documentation about the File class for more info about it.
    */ For the displaying the pdf part is it good enough if you load the accrobat reader and with it. In that case you can do that using the Runtime.exec
    Also you can search for free java based pdf viewers I am sure there must be meny.
    And also the JTextPane might support pdf but I am not sure about it.
    EDIT:
    Just to say that this is my 1000th post :)
    Message was edited by:
    LRMK

  • RE: [Adobe Reader] when i open pdf file it open all the pages but some pages give error massage (there was error processing a page,there was a problem reading this document 110) but if i open this page which give me error with google chrome it's work ? i

    HelloThank's for your helpsI hope this document is helpfulBest Regards,
    Date: Sun, 22 Jun 2014 17:10:17 -0700
    From: [email protected]
    To: [email protected]
    Subject:  when i open pdf file it open all the pages but some pages give error massage (there was error processing a page,there was a problem reading this document 110) but if i open this page which give me error with google chrome it's work ? if you can help me th
        when i open pdf file it open all the pages but some pages give error massage (there was error processing a page,there was a problem reading this document 110) but if i open this page which give me error with google chrome it's work ? if you can help m
        created by Anoop9178 in Adobe Reader - View the full discussion
    Hi,
    Would it be possible for you to share the document?
    Regards,
    Anoop
         Please note that the Adobe Forums do not accept email attachments. If you want to embed a screen image in your message please visit the thread in the forum to embed the image at https://forums.adobe.com/message/6485431#6485431
         Replies to this message go to everyone subscribed to this thread, not directly to the person who posted the message. To post a reply, either reply to this email or visit the message page:
         To unsubscribe from this thread, please visit the message page at . In the Actions box on the right, click the Stop Email Notifications link.
         Start a new discussion in Adobe Reader by email or at Adobe Community
      For more information about maintaining your forum email notifications please go to http://forums.adobe.com/thread/416458?tstart=0.

    thank's for reply and your help
    i did the step's that you told me but  i still have the same problem
                                     i have the latest v.11.0.7
    i
    i disable the protected mode

Maybe you are looking for

  • Fast Refresh MVs and HASH_SJ Hint

    I am building fast refresh MVs on a 3rd party database to enable faster reporting. This is an interim solution whilst we build a new ETL process using CDC. The source DB has no PKs, so I'm creating the MV logs with ROWID. When I refresh the MV (exec

  • Can I get Apps for my Ipod version 3.1.3

    Hello I have looked for apps for music like garage band, music recording related, then I thought I would just settle for a Uchre game.  I have a very old ipod version 3.1.3 (7E18) .   Thanks TR@aim4you

  • Taxes, freight etc. values to be added to stock values at the GR

    We are procuring the material from vendor. Our requirement is the taxes, freight, duties which we pay at the time of procurement should be added to stock values at the time of GR. Also we wish to pay the freight or duties to separate vendor at the ti

  • What hapenned to the MJPEG codec in Vision 2012 SP1?

    NOTE:  This discussion is about the 64 bit version of the Vision toolkit! NI has re-vamped its AVI functions in the latest Vision toolkit (2012 SP1).  At first glance, the new AVI functions work fine.  At least the 64 bit version now has a wider sele

  • Migrating folders to various instances

    Hi, I have around 9-10 folders added to Disco Admin in my development database. There are already various business areas and folders within it. I have created joins for these 9-10 newly added folders to the existing folders. Now when I want to migrat