Options to insert a BigInteger in a file

Good days,
As the title says, this more than a doubt is a search of alternatives.
I have a program that performs calculations whose result is a number of several dozens of thousands of digits saved in a variable of type BigInteger. At the moment of returning the result, I use a file to save it.
The problem appears at the moment of handling the number to be able to insert it in the file, because it takes a lot of time. In the last execution that I have done, it took 8 minutes to compute, 19 minutes to transform the BigInteger to a String and barely a second to insert it into the file.
The question is whether anyone knows any more efficient way to perform this step, perhaps with an alternative class to BufferedWriter that I have used to insert in the file and in which we need a char or String as a parameter.
Is important that the file could be read directly by a human.
Regards and thanks.

I don't know how NIO API can help me.
The only quick way I've found to insert the BigInteger in a file is using an ObjectOutputStream, but this creates a file unreadable to me and when I use the method toString() to insert as a String having it readable, it takes too time.
Before opening this item, I've been looking all the types of buffers and OutpuStreams that I found on the API, several of them mentioned in the NIO API, and I've tested to see if some served me. At the end I haven't found any which allow me to avoid the method toString().
Edited by: JaimeLG on Sep 8, 2008 12:35 PM

Similar Messages

  • Is it possible to insert data from a .txt file onto a form list?

    Hello everyone i have a question and really hope someone can help me out...
    I have made a form list in acces but now i want the option to insert data from a .txt automatically to that list in shaprepoint.. is this possible????
    * I forgot to say that i cannot use any third party software or powershell becauseof the limitations that i have in the comapny..

    If it's in Access, than you can consider linking this to your SharePoint List. I'm not sure what sort of options you'll have with just a text file.
    You might consider replacing that text file with an Excel Sheet and uploading it to the list with this Excel add-in
    http://www.microsoft.com/en-us/download/details.aspx?id=9345
    Steven Andrews
    SharePoint Business Analyst: LiveNation Entertainment
    Blog: baron72.wordpress.com
    Twitter: Follow @backpackerd00d
    My Wiki Articles:
    CodePlex Corner Series
    Please remember to mark your question as "answered" if this solves (or helps) your problem.

  • Please help! I defragged my hard drive and now Illustrator CS6 is trying to open all of my complex Illustrator files with a "Text Import Options" box as if they are text files, and they are not opening!

    Please help! Illustrator CS6 started trying to open all of my complex.ai files with a "Text Import Options" box as if they were text files, and they are not opening!  Help!

    Hi Monika,
    I have spent the last two or three days trying to do what you suggested.  I uninstalled Adobe 6 from Windows.  Some files that CS6 placed on my system during installation remained, including fonts and .dll files.
    I had to abandon the Cleaner Tool you suggested because in one screen it allowed me to specify removing CS6 only, but on the following screen it only gave on option to remove ALL Adobe programs.  I could not do that because I didn't have the serial number handy for CS3 in case I want to reinstall it at some point.
    I tried to get technical help with the Cleaner Tool problem but no definitive help was available, so I reinstalled CS6 again without having the benefit of the Cleaner Tool.  I tried to get the serial number for CS3 so I could use the Cleaner Tool but spent 2 wasted hours in chat.  Even though I had a customer number, order number, order date, place of purchase, the email address used AND 16 digits of the serial number, in two hours the agent couldn't give me the serial number.  After two hours I had nothing but instructions to wait another 20 minutes for a case number.
    Illustrator CS6 is still trying to open some backups as Text and otherNone of the problems have been fixed.  I have tried to open/use the .ai files in CS6 installed on another system and am getting the same result, so I don't think the software was damaged by the cleaner.  The hard drive cleaner is well-known and I've run it many times without any problem to previous versions of Illustrator or any other programs.
    When I ordered, the sale rep promised good technical support and gave me an 800 number, but after I paid the $2000, I learned that the 800 number she gave me doesn't support CS6 and hangs up on me.  Adobe doesn't call it a current product even though they just sold it to me about 3 weeks ago.
    Would appreciate any help you experts can offer.  If I can't solve this, the last backup I can use was from June and I will have lost HUNDREDS of hours of work and assets that I cannot replace.
    Exhausted and still desperately in need of help...

  • Insert animated gif or flash files (.swf) in Form?

    How can i insert animated gif or flash files (.swf) or another type of animated files in Form?

    If you are web deployed you can put an animated gif as the image to an iconic button.
    Image items cannot display animated gifs.
    Anything else you can do through a JavaBean if you need to.

  • Error when inserting into dynamically created filename-file

    Howry
    Am am receiving the following error when i am trying to insert into a file that have a dynamic filename (through declared variable, as date etc.).
    I presume it is trying to look for the target file with the same name as the dynamic value passed through by the variable, but cannot find it- can anyone tell me how i can rather create the file as appose to insert into an already created file..?
    Your help in this regard is much appreciated.
    Here is the error:
    ODI-1217: Session SAPO_hlr_suburbs (1577001) fails with return code 7000.
    ODI-1226: Step 6_Ins_final fails after 1 attempt(s).
    ODI-1240: Flow 6_Ins_final fails while performing a Integration operation. This flow loads target table #l_date.unl.
    ODI-1228: Task 6_Ins_final (Integration) fails on the target FILE connection SAPO_HLR_SUBURBS.
    Caused By: java.sql.SQLException: File C:\Files\Gero work\ODI In Files\SAPO_HLR_SUBURBS/2012-01-24 12:06:13.463.unl was not found
         at com.sunopsis.jdbc.driver.file.FileConnection.prepareForWriting(FileConnection.java:339)
         at com.sunopsis.jdbc.driver.file.impl.commands.CommandInsert.execute(CommandInsert.java:50)
         at com.sunopsis.jdbc.driver.file.CommandExecutor.executeCommand(CommandExecutor.java:33)
         at com.sunopsis.jdbc.driver.file.FilePreparedStatement.executeUpdate(FilePreparedStatement.java:138)
         at com.sunopsis.sql.SnpsQuery.executeUpdate(SnpsQuery.java:665)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.executeUpdate(SnpSessTaskSql.java:3218)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.execStdOrders(SnpSessTaskSql.java:1785)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTaskTrt(SnpSessTaskSql.java:2805)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSqlI.treatTaskTrt(SnpSessTaskSqlI.java:68)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTask(SnpSessTaskSql.java:2515)
         at com.sunopsis.dwg.dbobj.SnpSessStep.treatAttachedTasks(SnpSessStep.java:534)
         at com.sunopsis.dwg.dbobj.SnpSessStep.treatSessStep(SnpSessStep.java:449)
         at com.sunopsis.dwg.dbobj.SnpSession.treatSession(SnpSession.java:1954)
         at oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor$2.doAction(StartSessRequestProcessor.java:322)
         at oracle.odi.core.persistence.dwgobject.DwgObjectTemplate.execute(DwgObjectTemplate.java:224)
         at oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor.doProcessStartSessTask(StartSessRequestProcessor.java:246)
         at oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor.access$0(StartSessRequestProcessor.java:237)
         at oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor$StartSessTask.doExecute(StartSessRequestProcessor.java:794)
         at oracle.odi.runtime.agent.processor.task.AgentTask.execute(AgentTask.java:114)
         at oracle.odi.runtime.agent.support.DefaultAgentTaskExecutor$2.run(DefaultAgentTaskExecutor.java:82)
         at java.lang.Thread.run(Thread.java:619)

    What operating system are you using?
    The name of your file has the time within it , you cant have a filename with ':' in it on Windows.
    Try using ALPHANUMERIC datatype for the variable and pull the current datetime as a char with something like :
    select to_char( sysdate ,'YYYY-MM_DD HHMISS') from dual

  • In my opinion, the real solution is for Apple to offer us a choice of the photo sort order in ITunes. My preference would be filename, perhaps with options to choose the Date Taken attribute, file timestamp or date modified filestamp (EXIF date fields as

    I tryed to sort my pictures with buying Apps and following suggestion from apple, but without any success. In my opinion, the real solution is for Apple to offer us a choice of the photo sort order in ITunes. My preference would be filename, perhaps with options to choose the Date Taken attribute, file timestamp or date modified filestamp.

    Not a problem when using iPhoto on a Mac, which the transfer of photos is primarily based on - not manually managing photo storage as seems to be common with Windoze.
    The same should be available with a supported photo management app on a PC.
    http://support.apple.com/kb/HT4221

  • Inserting line in a Text file using java

    Hi,
    I am working on a project in which the some data is required to be stored in a text file. I have lines of data in the file and I read 1 line at a time. So now I need to insert some lines of text in between. How to do this ??
    Now i'm using a temporary file and then after creating the data I replace the original file with the new one. But want to know is there any better way to do that same..?!?!

    Ok.. If I maintain a data in XML format, is it
    possible to insert a node. I'm using Xerces and DOM
    api for handling xml data.
    As a file, XML is just a text file so you insert as you would any file.
    Once parsed to a DOM model then sure you can insert nodes. Just look at the Javadoc for XML Document, Element, Node etc.

  • What is the efficient way of insert some bytes into a file?

    Hello, everyone:
    If I want to insert some bytes into a file (for example, insert the bytes before all the original content of the file, or append the bytes to a file), and the size of the original file is very big. I am wondering what is the efficient way? Where can I get some sample codes?
    regards,
    George

    Thanks, DrClap.
    I have tried your method and you are correct. I have written a simple program which can be used to insert "Hello World " to the start of a file ("c:\\temp\\input.txt"), and I have verified that it can work. Please help to see whether it is correct and whether it has a more efficient way.
    public class TestDriver {
         public static void main(String[] args) {
              byte[] back_buffer = new byte [1024];
              byte[] write_buffer = new byte [1024];
              System.arraycopy("Hello World".getBytes(), 0, write_buffer, 0, "Hello World".getBytes().length);
              int write_buffer_length = "Hello World ".getBytes().length;
              int count = 0;
              FileInputStream fis = null;
              FileOutputStream fos = null;          
              try {
                   fis = new FileInputStream (new File("c:\\temp\\input.txt"));
                   fos = new FileOutputStream (new File("c:\\temp\\output.txt"));
                   while ((count = fis.read (back_buffer)) >= 0)
                        fos.write(write_buffer, 0, write_buffer_length);
                        System.arraycopy (back_buffer, 0, write_buffer, 0, count);
                        write_buffer_length = count;
                   //write the last block
                   fos.write(write_buffer, 0, write_buffer_length);
                   fis.close();
                   fos.close();
                   //copy content back into original file
                   fis = new FileInputStream (new File("c:\\temp\\output.txt"));
                   fos = new FileOutputStream (new File("c:\\temp\\input.txt"));
                   while ((count = fis.read (back_buffer)) >= 0)
                        fos.write(back_buffer, 0, count);
                   fis.close();
                   fos.close();
                   //remove temporary file
                   File f = new File ("c:\\temp\\output.txt");
                   f.delete();
              } catch (FileNotFoundException e) {
                   // TODO Auto-generated catch block
                   e.printStackTrace();
                   try {
                        fis.close();
                   } catch (IOException e1) {
                        // TODO Auto-generated catch block
                        e1.printStackTrace();
                   try {
                        fos.close();
                   } catch (IOException e2) {
                        // TODO Auto-generated catch block
                        e2.printStackTrace();
              } catch (IOException e) {
                   // TODO Auto-generated catch block
                   e.printStackTrace();
                   try {
                        fis.close();
                   } catch (IOException e1) {
                        // TODO Auto-generated catch block
                        e1.printStackTrace();
                   try {
                        fos.close();
                   } catch (IOException e2) {
                        // TODO Auto-generated catch block
                        e2.printStackTrace();
    }regards,
    George

  • Inserting Leads into a Text File?

    Hello there, I am wondering if there is a way to insert leads
    into a .txt file once a form is submitted?
    If so how would this be achieved. I know you can do this with
    PHP as I have done it before.
    Thanks
    Derek Bess

    > insert leads into a .txt file
    There are plenty of file tags and functions available. But
    what do you mean by "leads"?
    http://livedocs.adobe.com/coldfusion/8/htmldocs/functions-pt0_20.html#1100017

  • No option to "save as" PDF to reduce file size in Preview

    There is no Save As option. I have tried exporting my pdf, there is no file size option when I do this. I have tried to duplicate the pdf as suggested in another topic on this forum, which also then didn't have the Save As option and also didn't have any file size options when trying to save in all the many ways which I had already tried. I also tried to print and save from there, which was another option suggested on this forum. That also didn't offer me any options to reduce the file size despite it being a "save as" window. I'm lost. Send Help.

    The screen capture won't let me snag the dropdown selection (attached) but the only options available to me are...
    Photoshop (*.PSD;*.PDD)
    Large Document Format (*.PSB)
    OpenEXR (*.EXR)
    Photoshop Raw (*.RAW)
    Portable Bit Map (*.PBM;*.PGM;*.PPM;*.PNM;*.PFM;*.PAM)
    Radiance (*.HDR;*.RGBE;*.XYZE)
    TIFF (*.TIF;*.TIFF)

  • Inserting a constant after a file name

    Hello all,
    I have been working on a Javascript for Acrobat Pro 9, which I want to pull the first page of a PDF file & move it to another folder, I have managed to achieve this, however it would also be useful to insert an additional part to the file name...
    /* Extract Cover Page Only As PDF */
    // regular expression acquire the base name of file
    var re = /.*\/|\.pdf$/ig;
    var filename = this.path.replace(re,"");
    try {
    i=0;
    this.extractPages(
    nStart: i,
    cPath: "/C/Documents and Settings/JBushfield/Desktop/Output/"+filename+".pdf"
    } catch (e) {
    console.println("Aborted: "+e)
    I can get the script to insert a prefix to the file name but when I try to move it to after the filename ie just before the .pdf it won't play ball. I talked a colleage, who suggested that maybe as the filename is (to Adobe) variable (it's actually always 13 digits as it is an ISBN), that maybe there is someway to include this, as in place text in name after the 13 digits but I am not sure.
    PS The text I want to include after the ISBN is "_Outside_Front_Cover"
    Any help on the matter would be greatly appreciated,
    Many Thanks
    Joe

    Hey Try67,
    Thanks so much for helping me out here, your solution works! In actual fact I hadn't tried that, I'd closed it off ..._cover with " before the .pdf, I guess that was it, you've really helped me here! Thanks for the support, I'm pretty new to Javascripting and you've given me that extra bit of motivation.
    Thanks
    Joe

  • Use of XMP Custom Panel to automate insertion of metadata into PDF file.

    I'm new to the world of XMP so please bear with me.
    I'm exploring ways of automating the insertion of metadata into PDF files, either at the time of creation, or through a batch process. The metadata values for a given set of documents would be static, so these could be "hard coded" into the mechanism use to insert the metadata.
    Would an XMP Custom Panel be something I could use to achieve this goal. If so, can you please provide some details on how to go about doing this.
    Thanks in advance.
    Louis

    Were you able to find a solution to this problem? I am having the same issue.
    Jason

  • Insert Object (create from pdf file) in wordpad fails

    Problem:
    I am unable to insert object (create from existing pdf file) in wordpad application.
    Environment:
    OS: Windows 7 Professional + SP1 (64-bit)
    Acrobat X (32-bit installer)
    Procedure:
    Open Wordpad application, click on 'Insert Object', choose 'Create from File', Browse and Select exsting pdf file, click 'Display As Icon' and Click 'Ok'
    Expexted Result:
    PDF should get inserted as OLE object to wordpad
    Actual Result:
    Error message "Failed to create object. Make sure the application is entered in the system registry."
    Addition Notes:
    I noticed that while insterting PDF (OLE object) it seach for certain registry key (AutoConvertTo) which is not available hence it fails.

    Yes, I am aware. But this problem appears only when I insert PDF file (which is Adobe file).
    I guess this has nothing to do specifically with 'wordpad' but I referenced known application from standard offiering. It happens with any 64-bit application using 'rich-edit' control (this is Microsoft too ) and allowing user to insert OLE objects.
    I guess somewhere Adobe Acrobat installation fails to create required registry entries which are being referred by 64-bit applications while inserting PDF files as OLE objects.

  • I have just downloaded itunes 10.6 and  in the process my "podcast" option under library has disappeared! The files are still on my laptop. I can also see some of my recorded music in my itunes library but can play them - there is an exclamation mark next

    I have just downloaded itunes 10.6 and in the process my "podcast" option under library has disappeared! THe files are still on my laptop. I can also see some of my recorded music in the itunes library but can't play them - there is an exclamation mark next to each track. Basically I can't use itunes - is the only option remove and replace? Thanks in advance

    Visibility of the Podcasts section is controlled from within the Edit > Preferences dialog.
    Empty/corrupt library after upgrade/crash
    Hopefully it's not been too long since you last upgraded iTunes, in fact if you get an empty/incomplete library immediately after upgrading then with the following steps you shouldn't lose a thing or need to do any further housekeeping. In the Previous iTunes Libraries folder should be a number of dated iTunes Library files. Take the most recent of these and copy it into the iTunes folder. Rename iTunes Library.itl as iTunes Library (Corrupt).itl and then rename the restored file as iTunes Library.itl. Start iTunes. Should all be good, bar any recent additions to or deletions from your library.
    See iTunes Folder Watch for a tool to catch up with any changes since the backup file was created.
    Missing tracks
    Typically this can happen because a file or folder is accidentally shunted to the wrong location. iTunes can also get confused if it expects to be talking to an external drive which isn't there. If will often reset the default media folder location and may have trouble finding files in the old folders.
    Select one of your tracks that is missing in action. Press CTRL-I to Get Info. Cancel when asked to try to locate the file, then look at the location given on the summary tab. This where iTunes thinks the file ought to be? Now find out where it actually is. Post back the two locations for comparison. I should be able to give you some steps to reconnect everything once I can determine which of the things that might have gone wrong is most likely in your case.
    When you get it all working make a backup!
    tt2

  • Option to insert layer greyed out dreamweaver CSS4

    Hello,
    I installed dreamweaver CSS4 and the option to insert a later is greyed out. I previously used dreamweaver MX 2004 to create my site. Is there a new way to insert layers? Thanks Andrea

    Murray, I'm going to get cranky here.
    When using AP Divs in concert with Flash and also in concert with Spry and other Javascript, you certainly do have to put them on the page in the right order or your Spry menus will not fall over your  AP Divs in visually-appropriate layering. This makes them tricky.
    The mantra that an AP Div is absolutely positioned relative to its containing element flies out the window in such situations. To be clear, one must re-think which containing element one is using...it doesn't not work...and the solution is to change one's thinking in terms of which containing element to use.
    I have recently worked (and worked and worked) on getting such a page to function the same in all browsers. So you can't tell me that they all render the same, because they do not. Ultimately, they did, but mainly because I changed my code.
    It is very possible that you have successfully internalized the order in which it is necessary to make things work from the very beginning (Good for you!) or you have heeded the generally trumpeted call to not use AP Divs. In constructing this particular page (a page with a large background image over which must be located numerous other bits, including a Spry Menu Bar), I worked from the top down as I usually do, and "top down" (top of the viewport from header to footer) is not always the same as "picture plane out" in stacking order.
    Every browser except the Microsoft browsers must be reading my mind and my assigned z-order, and interpreting stacking as I do, as I work from the top down. Microsoft insists that APDivs that will later be expected to "lie down" under Spry Menus and so forth be coded and loaded BEFORE those Spry Menus show up.
    So as I worked, I converted some of the AP Divs (conveniently positioned, but ultimately unworkable because of IE) to Relative Divs. It is not a system I use frequently, and it is not my usual system, and it is not the system I would necessarily recommend, but it is possible as a solution to an untenable situation.
    Such is my experience, decidedly on a shorter calendar than yours, but there it is.
    Beth

Maybe you are looking for

  • Photoshop 5.1 won't run on brand new Mac with Yosemite

    Help please! I am a photography teacher and I just purchased 8 brand new MacBook pros for my classroom. I asked my IT guy to install Photoshop 5.1 on all of them. On 3 of the 8, it is not working. I get a window that says "For the Photoshop UI to dis

  • My iTunes won't register that I have plugged in my iPhone 5.

    I got a new iPhone 5 and when I plugged it into iTunes it wouldn't pick up that I had an iPhone connected to the computer.  I plugged it in again today and it registered but it wouldn't load or sync. So after that I backed up my iTunes library, delet

  • File sizes on shared reviews are becoming quite huge... how to reduce?

    We have many .pdf's that are shared out for review for users to make comments on.  It appears that every single stroke is being recorded as a markup which may be causing the huge increase in the .pdf file size.  Is there a way to condense these comme

  • CS 5.5 Deactivation for use on new machine

    I purchased a boxed version of Production Premium CS 5.5 a couple of years ago and installed it on one computer.  I later upgraded to CS 6 via Creative Cloud and am still a full CC subscriber (installed on two machines).  My original CS 5.5 suite has

  • Photoshop license for personal use

    Hello, i'd like to know wether it was forbidden to use Photoshop without paying that much, for a personal use (or in extension until where is it considered illegal, for example for an association poster, for just the family) is it linked to profit or