Along the lines of How To Lead Large Files

I have some mainframe extract files loaded onto a Solaris drive that are between 1 and 4 GB to be used in an initial load of a data warehouse. I can't even open a file with file sizes that large. (We're running JDK 1.2.2 - not sure if that matters.) I'm using this statement -
bufReader = new BufferedReader(new InputStreamReader(new FileInputStream(fileName)));
This is the error I get on that statement -
java.io.FileNotFoundException: /wrhs_data/export.13.aug02 (Value too larg)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(FileInputStream.java:68)
at com.cofinity.importer.MyFileReader.open(MyFileReader.java:40)
at com.cofinity.importer.MyFileReader.main(Compiled Code)
The statement works fine on files less than 220 MB. It breaks somewhere between 220 and 804 MB.
From the error message it seems that the underlying Native call can't handle opening such a large file. I've searched for the "value to larg" sub-message and found nothing. I tried eliminating the BufferedReader and just using the InputStreamReader, but I received the same error.
Does anyone know how Java can read large files in the 1 to 4 GB range? (I suppose I could use something like Informatica to split the files up, but our disk space is at a premium.) Any help would be greatly appreciated.
Thanks,
Steve

Well it appears to fail in open(). I tried your code on a binary file of size 25739135241 bytes (23.9+ gibibytes) on AIX and it did just fine, so it may be something in the runtime, try upgrading to a newer JDK/SDK, failing that, use the OS to stream in your data:
BufferedReader br = new BufferedReader(
        new InputStreamReader(System.in)
);And just pipe/redirect your file to your Java processes' standard in.

Similar Messages

  • Along the lines of How to burn DVD's

    I was trying to burn a simple data CD. Dragged the files to the CD in Finder saw the alias, hit burn. After a moment (spinning pinwheel) I get an error message saying:
    Burning the disc failed because one or more items in "Desktop.fpbf" could not be read.
    Could not read '/Library/Caches/com.apple.IntlDataCache.Ie.4294967294
    Is this an error with the disk (they are old Maxell CD-Rs), error with the files being cooked, they are med. res jpegs or as I fear a missing/corrupt file in the OS?
    Any help is appreciated.

    MH Holden wrote:
    I was trying to burn a simple data CD. Dragged the files to the CD in Finder saw the alias, hit burn.
    After a moment (spinning pinwheel) I get an error message saying:
    Burning the disc failed because one or more items in "Desktop.fpbf" could not be read.
    I presume you created a burn folder.
    Could not read '/Library/Caches/com.apple.IntlDataCache.Ie.4294967294
    Is this an error with the disk (they are old Maxell CD-Rs), error with the files being cooked, they are med. res jpegs or as I fear a missing/corrupt file in the OS?
    Any help is appreciated.
    Why not really simplify it? Insert a blank, after it mounts double click it to open it and drag a file into the window. It will be an alias of the actual file which is correct and normal.
    Select File->Burn Disc and see what happens.
    If you want to save money, use a R/W disk for starters.

  • I have just redeemed my iTunes card of 25 dollars, I have 23 dolIars left now, I tried downloading a few songs later, but it says something along the lines of credit mismatch mobile message, I can't download anything with credit. How do I fix the problem?

    I really need help, I purchased an iTunes card about an hour ago and downloaded two things, I tried to download a couple songs but it won't let me, every time I try it says something along the lines of credit mismatch mobile message. How do I fix this? It says I have 23 dollars left but it's not working. How do I fix the problem? Please help!

    its very annoying but you have to log out of your account. than try to buy the sone. it will ask you to sign in. do it. the sond will start to download. it only works once, so you have to do it over and over for every song :/

  • I think my computer has a virus, when I get on the Internet, ads will pop up all the time, I think it is called adware?  Also pages will pop up saying something along the lines of my computer is at risk for some security issue. What should I do?

    I think my computer has a virus, when I get on the Internet, ads will pop up all the time, I think it is called adware?  Also pages will pop up saying something along the lines of my computer is at risk for some security issue. What should I do?

    Remove Browser Pop-up Problems
         AdwareMedic
         Adblock Plus 1.8.9
         remove adware that displays pop-up ads and graphics on your Mac
    Helpful Links Regarding Malware Problems
    If you are having an immediate problem with ads popping up see The Safe Mac » Adware Removal Guide and AdwareMedic. If you require anti-virus protection Thomas Reed recommends using ClamXAV. (Thank you to Thomas Reed for this recommendation.)
    Open Safari, select Preferences from the Safari menu. Click on Extensions icon in the toolbar. Disable all Extensions. If this stops your problem, then re-enable them one by one until the problem returns. Now remove that extension as it is causing the problem.
    The following comes from user stevejobsfan0123. I have made minor changes to adapt to this presentation.
    Fix Some Browser Pop-ups That Take Over Safari.
    Common pop-ups include a message saying the government has seized your computer and you must pay to have it released (often called "Moneypak"), or a phony message saying that your computer has been infected, and you need to call a tech support number (sometimes claiming to be Apple) to get it resolved. First, understand that these pop-ups are not caused by a virus and your computer has not been affected. This "hijack" is limited to your web browser. Also understand that these messages are scams, so do not pay any money, call the listed number, or provide any personal information. This article will outline the solution to dismiss the pop-up.
    Quit Safari
    Usually, these pop-ups will not go away by either clicking "OK" or "Cancel." Furthermore, several menus in the menu bar may become disabled and show in gray, including the option to quit Safari. You will likely have to force quit Safari. To do this, press Command + option + esc, select Safari, and press Force Quit.
    Relaunch Safari
    If you relaunch Safari, the page will reopen. To prevent this from happening, hold down the 'Shift' key while opening Safari. This will prevent windows from the last time Safari was running from reopening.
    This will not work in all cases. The shift key must be held at the right time, and in some cases, even if done correctly, the window reappears. In these circumstances, after force quitting Safari, turn off Wi-Fi or disconnect Ethernet, depending on how you connect to the Internet. Then relaunch Safari normally. It will try to reload the malicious webpage, but without a connection, it won't be able to. Navigate away from that page by entering a different URL, i.e. www.apple.com, and trying to load it. Now you can reconnect to the Internet, and the page you entered will appear rather than the malicious one.

  • ITunes unable to recognize iPod, error message along the lines if "iTunes has detected an iPod but unable to recognise" I have followed all the trouble shooting tips and am still stuck? I am now being told by a friend I need a link sent to me to fix this

    Hi,
    I am need of help! I have had this issue for a while now and it's becoming frustrating.
    My iTunes installed on my HP Windows 8 Netbook is unable to recognize my iPod, the error message along the lines of "iTunes has detected an iPod but unable to recognise"
    I have followed all the trouble shooting tips and am still stuck? I am now being told by a friend I need a link sent to me to fix this??
    Someone please help me fix this problem.
    Many thanks.
    Matt.

    Hi
    So just close iTunes and re-open iTunes thats it and that worked for you?
    When you say reset your settings do you mean to factory settings? As my iPod was swapped at the store for a new one and the problem is still there...
    Thanks.

  • I bought my I pod touch 3-4 months ago and I got this message all of a sudden, it said something along the lines of provisonal complete_Distrib... will expire in 30 days. What is this it's under setting-general-Profile should I be worried?

    I bought my I pod touch 3-4 months ago and I got this message all of a sudden, it said something along the lines of provisonal complete_Distrib... will expire in 30 days. What is this it's under setting-general-Profile should I be worried? Should I just let it expire.

    Unless you have a company or school iPod, that profile was installed by an app you installed. It is likely that the app will no longer function when that date is reached. You can Google the name of the profile and that may provide some more information.

  • When viewing a photo in full screen, how do I get the file information and data along the footer.  How do i get that to go off?  Preferences.....???

    Love full screen view, but my file information and data are showing along the footer.  How do I change me settings so this doesn't show?
    Thanks!!!!

    Anne, didn't the answers Frank and I gave in the other tread work? See:
    Re: How do I turn of the focus points in Aperture when viewing a photo in a non-thumbnail view?  Thanks!
    Or did you want to know something differently?

  • How can I fill structure from the line with contetnt of a XML file inside?

    How can I fill structure from the line with contetnt of a XML file inside?
    I have array of lines with XML documents inside. All XML's have the same structure.
    I need to fill array of structures (with the same structure like given XML's) from data of these XML's.
    How can I do this? I am trying Transformation with ora:parseEscapedXML, but receive error: "XPath expression failed to execute.
    Error while processing xpath expression, the expression is "ora:processXSLT("Transformation_1.xsl", bpws:getVariableData("ProcessedFiles"))", the reason is javax.xml.transform.TransformerException: javax.xml.transform.TransformerException: Could not find function: parseEscapedXML.
    Please verify the xpath query."

    Ive posted the new code but now I'm getting a FileAlreadyExistException error. How do I handle this exception error correctly in my code?
    import java.io.IOException;
    import java.nio.file.FileAlreadyExistsException;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    import javax.xml.parsers.DocumentBuilder;
    import javax.xml.parsers.DocumentBuilderFactory;
    import javax.xml.parsers.ParserConfigurationException;
    import org.w3c.dom.Document;
    import org.w3c.dom.Element;
    import org.w3c.dom.Node;
    import org.w3c.dom.NodeList;
    import org.xml.sax.SAXException;
    public class MyDomParser {
      public static void main(String[] args) {
      DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
      try {
      DocumentBuilder builder = factory.newDocumentBuilder();
      Document doc = builder.parse("ENtemplate.xml");
      doc.normalize();
      NodeList rootNodes = doc.getElementsByTagName("templates");
      Node rootNode = rootNodes.item(0);
      Element rootElement = (Element) rootNode;
      NodeList templateList = rootElement.getElementsByTagName("template");
      for(int i=0; i < templateList.getLength(); i++) {
      Node theTemplate = templateList.item(i);
      Element templateElement = (Element) theTemplate;
      System.out.println(templateElement.getAttribute("name")+ ".xml");
      for(int i=0; i < templateList.getLength(); i++) {
      Node theTemplate = templateList.item(i);
      Element templateElement = (Element) theTemplate;
      String fileName = templateElement.getAttribute("name") + ".xml";
      Files.createFile(Paths.get(fileName));
      System.out.println("File" + ":" + fileName + ".xml created");
      } catch (ParserConfigurationException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
      } catch (SAXException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
      } catch (IOException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();

  • Iphone 4s stuck during OS upgrade 1/2 way along the line under the Apple LOGO.  what can i do to unstick it.

    during an upgrade to the latest OS version on our IPHONE 4S, it stopped updating about 1/2 way along the line under the APPLE LOGO.  what can I do to complete, or restart the update?

    Hi ..
    Depends on whether you're doing this wirelessley or using iTunes >  Update your iPhone, iPad, or iPod touch
    iOS: Unable to update or restore

  • Problem!!! Moving point along the line

    hi,
    I need to move the point along the line. I want move this point using mouse.
    My program draws a line and a point that' s on this line.
    Could someone help me.

    import java.awt.*;
    import java.awt.event.*;
    import java.awt.geom.*;
    import javax.swing.*;
    import javax.swing.event.MouseInputAdapter;
    public class TraverseAgain extends JPanel {
        Point2D.Double[] points;
        Point2D.Double p1;
        Point2D.Double p2;
        /** An endPoint of one of the lines is being moved. */
        public void setEndPoint(int index, double x, double y) {
            int start;
            double ratio;
            switch(index) {
                case 0:
                    start = index == 0 ? 1 : 0;
                    ratio = getRatio(p1, start, index);
                    resetMidPoint(p1, points[start], x, y, ratio);
                    break;
                case 1:
                    start = index == 0 ? 1 : 0;
                    ratio = getRatio(p1, start, index);
                    resetMidPoint(p1, points[start], x, y, ratio);
                    start = index == 1 ? 2 : 1;
                    ratio = getRatio(p2, start, index);
                    resetMidPoint(p2, points[start], x, y, ratio);
                    break;
                case 2:
                    start = index == 1 ? 2 : 1;
                    ratio = getRatio(p2, start, index);
                    resetMidPoint(p2, points[start], x, y, ratio);
                    break;
                default:
                    System.out.println("illegal index: " + index);
            points[index].setLocation(x, y);
            repaint();
         * Design assumption/decision:
         * Preserve this ratio when repositioning a midPoint between the
         * end points of its line when one of the end points is being moved.
        private double getRatio(Point2D.Double p, int start, int end) {
            double d1 = points[start].distance(p);
            double d2 = points[start].distance(points[end]);
            return d1 / d2;
        private void resetMidPoint(Point2D.Double p, Point2D.Double end,
                                   double x, double y, double ratio) {
            double dy = y - end.y;
            double dx = x - end.x;
            double theta = Math.atan2(dy, dx);
            double length = end.distance(x, y);
            x = end.x + length*ratio*Math.cos(theta);
            y = end.y + length*ratio*Math.sin(theta);
            p.setLocation(x, y);
        /** A midPoint is being moved. */
        public void setMidPoint(int number, double x, double y) {
            switch(number) {
                case 1:
                    double dx = points[1].x - points[0].x;
                    double dy = points[1].y - points[0].y;
                    if(points[0].x < x && x < points[1].x ||
                       points[1].x < x && x < points[0].x)
                        y = points[0].y + (x - points[0].x)*(dy / dx);
                    else if(points[0].y < y && y < points[1].y ||
                            points[1].y < y && y < points[0].y)
                        x = points[0].x + (y - points[0].y)*(dx / dy);
                    else
                        return;
                    p1.setLocation(x, y);
                    break;
                case 2:
                    dx = points[2].x - points[1].x;
                    dy = points[2].y - points[1].y;
                    if(points[1].x < x && x < points[2].x ||
                       points[2].x < x && x < points[1].x)
                        y = points[1].y + (x - points[1].x)*(dy / dx);
                    else if(points[1].y < y && y < points[2].y ||
                            points[2].y < y && y < points[1].y)
                        x = points[1].x + (y - points[1].y)*(dx / dy);
                    else
                        return;
                    p2.setLocation(x, y);
                    break;
                default:
                    System.out.println("illegal number " + number);
            repaint();
        protected void paintComponent(Graphics g) {
            super.paintComponent(g);
            Graphics2D g2 = (Graphics2D)g;
            g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
                                RenderingHints.VALUE_ANTIALIAS_ON);
            if(points == null)
                initGeoms();
            g2.setPaint(Color.blue);
            for(int j = 1; j < points.length; j++)
                g2.draw(new Line2D.Double(points[j-1].x, points[j-1].y,
                                          points[j].x,   points[j].y));
            g2.setPaint(Color.red);
            for(int j = 0; j < points.length; j++)
                mark(points[j], g2);
            g2.setPaint(Color.green.darker());
            mark(p1, g2);
            mark(p2, g2);
        private void mark(Point2D.Double p, Graphics2D g2) {
            g2.fill(new Ellipse2D.Double(p.x-2, p.y-2, 4, 4));
        private void initGeoms() {
            int w = getWidth();
            int h = getHeight();
            points = new Point2D.Double[3];
            points[0] = new Point2D.Double(w/4, h/3);
            points[1] = new Point2D.Double(w/16, h/2);
            points[2] = new Point2D.Double(w*13/15, h*3/4);
            double cx = points[0].x + (points[1].x - points[0].x)/2;
            double cy = points[0].y + (points[1].y - points[0].y)/2;
            p1 = new Point2D.Double(cx, cy);
            cx = points[1].x + (points[2].x - points[1].x)/2;
            cy = points[1].y + (points[2].y - points[1].y)/2;
            p2 = new Point2D.Double(cx, cy);
        public static void main(String[] args) {
            TraverseAgain test = new TraverseAgain();
            PointMover mover = new PointMover(test);
            test.addMouseListener(mover);
            test.addMouseMotionListener(mover);
            JFrame f = new JFrame();
            f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            f.getContentPane().add(test);
            f.setSize(400,400);
            f.setLocation(200,200);
            f.setVisible(true);
    class PointMover extends MouseInputAdapter {
        TraverseAgain traverseAgain;
        int selectedEndIndex = -1;
        int selectedMidNumber = -1;
        Point2D.Double offset = new Point2D.Double();
        boolean dragging = false;
        final int MIN_DIST = 5;
        public PointMover(TraverseAgain ta) {
            traverseAgain = ta;
        public void mousePressed(MouseEvent e) {
            Point p = e.getPoint();
            Point2D.Double[] points = traverseAgain.points;
            for(int j = 0; j < points.length; j++) {
                if(points[j].distance(p) < MIN_DIST) {
                    selectedEndIndex = j;
                    rigForDrag(points[j], p);
                    break;
            if(selectedEndIndex == -1) {
                if(traverseAgain.p1.distance(p) < MIN_DIST) {
                    selectedMidNumber = 1;
                    rigForDrag(traverseAgain.p1, p);
                } else if(traverseAgain.p2.distance(p) < MIN_DIST) {
                    selectedMidNumber = 2;
                    rigForDrag(traverseAgain.p2, p);
        private void rigForDrag(Point2D.Double p, Point loc) {
            offset.x = loc.x - p.x;
            offset.y = loc.y - p.y;
            dragging = true;
        public void mouseReleased(MouseEvent e) {
            dragging = false;
            selectedEndIndex = -1;
            selectedMidNumber = -1;
        public void mouseDragged(MouseEvent e) {
            if(dragging) {
                double x = e.getX() - offset.x;
                double y = e.getY() - offset.y;
                if(selectedEndIndex != -1)
                    traverseAgain.setEndPoint(selectedEndIndex, x, y);
                else
                    traverseAgain.setMidPoint(selectedMidNumber, x, y);
    }

  • How to upload large file with http via post

    Hi guys,
    Does anybody know how to upload large file (>100 MB) use applet to servlet with http via post method? Thanks in advance.
    Regards,
    Mark.

    Hi SuckRatE
    Thanks for your reply. Could you give me some client side code to upload a large file. I use URL to connect to server. It throws out of memory exception. The part of client code is below:
    // connect to the servlet
    URL theServlet = new URL(servletLocation);
    URLConnection servletConnection = theServlet.openConnection();
    // inform the connection that we will send output and accept input
    servletConnection.setDoInput(true);
    servletConnection.setDoOutput(true);
    // Don't used a cached version of URL connection.
    servletConnection.setUseCaches (false);
    servletConnection.setDefaultUseCaches(false);
    // Specify the content type that we will send text data
    servletConnection.setRequestProperty("Content-Type",
    +"application/octet-stream");
    // send the user string to the servlet.
    OutputStream outStream = servletConnection.getOutputStream();
    FileInputStream filein = new FileInputStream(largeFile);
    //BufferedReader in = new BufferedReader(new InputStreamReader
    +(servletConnection.getInputStream()));
    //System.out.println("tempCurrent = "+in.readLine());
    byte abyte[] = new byte[2048];
    int cnt = 0;
    while((cnt = filein.read(abyte)) > 0)
    outStream.write(abyte, 0, cnt);
    filein.close();
    outStream.flush();
    outStream.close();
    Regards,
    Mark.

  • How to transfer large files(1GB) to pc

    How to transfer large files(1GB) to pc

    Or possibly alternatively, and if really desperate, upload it to file distribution service like Fileserve or Rapidshare and then download it from the other machine (and then delete the upload).  Many of these services have a free mode although they may have size limitations and they certainly throttle the download speed down (Rapidshare may be one of the worse, Fileserve one of the best).  Personally I never tried something the size of 3GB.  What I do see is that stuff that large is generally broken up into multiple files to get around the size limitations and to be glued together when all the parts are downloaded.
    Just throwing this "out there" as an alternative but as I said, you probably would need to really be desparate to go this route

  • Utl_file.utl_raw adds a line feed at the end of the line. How to avoid it.

    utl_file.utl_raw adds a line feed at the end of the line. I have to send some binary files to my vendor and they do not want a line feed at the end of the line.
    When I execute the sample program below, it creates a file with a line feed(chr(10)) at the end of the line. When I do dump in hexa, it shows a character x0A
    How to avoid the line feed at end of line?
    We are using Oracle 9i on unix platform.
    declare
    l_output           utl_file.file_type;
    v_raw      raw(32767);
    v_trlr_rec_code      VARCHAR2(2);
    v_trlr_evnt_title      VARCHAR2(6);
    begin
    l_output := utl_file.fopen( 'RM_MHE_IN_DIR', 'abc.dat', 'w', 14 );
    v_trlr_rec_code      := '99';
    v_trlr_evnt_title      := 'STARTD';
    v_raw := HEXTORAW(v_trlr_rec_code) || utl_raw.cast_to_raw(v_trlr_evnt_title);
    utl_file.put_raw( l_output, v_raw );
    utl_file.fflush( l_output );
    utl_file.fclose( l_output );
    dbms_output.put_line( utl_raw.cast_to_varchar2( v_raw ) );
    EXCEPTION
    WHEN OTHERS THEN
         dbms_output.put_line( sqlerrm );
    end;
    /

    oops, sorry i overlooked the fact that the db is 9i; thanks for pointing it out Solomon.
    Not sure about this, but a workaround could be to remove the "\n" characters at the end of each line using one of the many Unix utilities after the file has been created.
    isotope

  • Can anyone advise on how to share large files over the net?

    Hi all.
    So I need to share large video files over the net.
    The files will be between 5 and 10 GB
    Does anyone have a solution for this?
    I have been using my ftp program and just giving the recipient the download link.
    But its affecting my upload quota and the recipients download quaota with our ISP's.
    Is there an easier way at all?
    Thanks.

    Contact the ISP for a temporary exception on the quota, or to get an explanation of how long before you can send a second segment for the download.  You can split large downloads by UUEncoding them, or making separate disk image segments with Disk Utility.  You could also find out if any local WiFi hotspots don't have a quota issue.  Lastly, you could send a thumbdrive by mail.

  • I am the owner of an account with 4 lines.  I cannot see the text messages for 1 of the lines.  How can I see them usage and phone numbers, not the content.  Thanks

    Looking to see the frequency and numbers texted on one of the lines which I am the account owner of.  I only see texts I placed to this number,

        Zoupie,
    This is something we can definitely figure out together! Are you able to get the phone for a few minutes? If so, please go to Settings>Cellular and scroll down. You will find a list of the apps on the phone. I'm curious to see if there are any messenger apps listed such as Snapchat, Facebook Messenger, Hangouts, ect...... These apps can send the messages via the internet connection instead of via our texting system and would not show up in our records.
    SarahO_VZW
    Follow us on Twitter @VZWSupport

Maybe you are looking for

  • Help Needed for Resetting VoIP SPA 2100 Codes

    Yesterday afternoon, I lost power to my home for a few minutes; until then my phone worked perfectly (for the week that I had it initially installed). I have the Earthlink TrueVoice program with a ZyXEL P 600 series DSL modem and direct Ethernet cabl

  • RTF Template: sums with nested groups

    Hi all, i've got quite a pickle of a problem it seems ... my data structure looks something like this: <COMPANY> --<STORE> ----<DEPARTMENT> ------<ITEM></ITEM> ----</DEPARTMENT> --</STORE> </COMPANY> multiple companies can have multiple stores, which

  • Need Help in Oracle Service Contracts API -- OKS_COVERAGES_PUB

    Hi All We have a requirement in service contracts module, wherein we have to delete the old coverage template of service line of a contract and attach the new template with the service line. For this, we are using OKS_COVERAGES_PUB ("OKS_COVERAGES_PU

  • Debliery Units : VENDOR IS NOT DEFINED FOR THIS SYSTEM

    Dear Experts, In prespective modeler , tried creating 'DELIVERY UNITS'. However get error message "CANNOT CREATE DELIVERY UNIT AS CONTENT VENDOR IS NOT DEFINED FOR THIS SYSTEM" ? How can we maintain CONTENT VENDOR ? we are using in-house HANA install

  • Out put in ALV grid format

    Hi,   i need a help from you my dear friend I'm providing you the following information in which i have extract some of the fields from two internal tables and i have to display it in the alv grid format. All the work was done successfully but the pr