How to Load 3D Array faster from a DataInputstream

Hi,
I have a task like reading a file using fileinputstream and loading the values into a 3Dimensional array. Before loading the array I need to convert each byte that i read into LittleEndian. I am attaching the code here
     public boolean loadIter(int iter) {
          try {
               picArray = new float[NUMOFIMAGES][HEIGHT][WIDTH];
               word = new byte[8];
               file = new File(fileName);
/*            long start = System.currentTimeMillis( );
*/               fileInput = new FileInputStream(file);
               dataInputStream = new DataInputStream(fileInput);
               dataInputStream.skipBytes(iter*NUMOFIMAGES*HEIGHT*WIDTH*4);
                    maxAll = 0;
                    for (int l = 0; l < NUMOFIMAGES; l++) {
                         for (int k = 0; k < HEIGHT; k++) {
                              for (int j = 0; j < WIDTH; j++) {
                                   dataInputStream.readFully(word, 0, 4);
                                   float in = Float.intBitsToFloat((word[3]) << 24 | (word[2] & 0xff) << 16
                                         | (word[1] & 0xff) << 8 | (word[0] & 0xff));
                                   picArray[l][k][j] = in;
                                   if(in > maxAll)
                                        maxAll = in;                                   
               fileInput.close();
/*            System.out.println(" Elapsed time is "+(System.currentTimeMillis()-start)/ 1000F
                        + "Seconds.");
*/               return true;
          } catch (IOException ioe) {
               System.err.println("initFile ioe " + ioe.getMessage());
               return false;
     }The above process is taking abt 15sec for 126(NUMOFIMAGES) 212(HEIGHT) & 212(WIDTH) which are constants for me. How can I make this whole thing faster. Are there any other techniques to improve performance?
Thanks

Create your DataInputStream like this:
dataInputStream = new DataInputStream(new BufferedInputStream(fileInput));
Does that help?

Similar Messages

  • Can anyone tell me how to load my music library from my PC down to my IPad??

    Some how when I updated the OS on my IPad I lost all my music in the IPOD section.  I would like to find out how to load my music library from my PC to my IPad?  Thanks.

    If you use iTunes See Here
    Syncing with iTunes
    From Here
    http://www.apple.com/support/ipad/syncing/
    Ipad User Guide
    http://manuals.info.apple.com/en_US/ipad_2_user_guide.pdf

  • How to load a selective request from PSA to DSO using DTP?

    Hi Gurus,
    The PSA is having 3 requests, how to load the request number 2 from psa to DSO using DTP?
    Thanks
    SDP
    Edited by: SDPSAP on Nov 15, 2011 7:58 PM

    Let us say that requests are 1,2 and 3. 1 being the first one and 3 is the last one. Now you need to load request 2 in DSO from PSA.
    - create a Delta DTP
    - Tick "Only Get Delta Once"
    - Tick "Get One Request Only"
    - Untick "Reterive Until No More New Data"
    - execute the DTP, it will load request 1 to DSO
    - delete this request from DTP
    - execute DTP again, it will load request 2 to DSO; this is what you need.
    If DSO is write optimized, you do not need to untick "Reterive Until no More New Data"; just execute the DTP, it will create 3 requests in DSO, delete first and last and you will get only 2 in DSO.
    I hope it helps.
    Regards,
    Gaurav

  • How to Load Master Data Text  from Multiple Source Systems

    Situation:  Loading vendor master (text) from two systems.  Some of the vendor keys/number are the same and so is the description.  I understand that if I was loading Attributes, I could create another attribute such a source system id and compound it to 0Vendor.  However, I don't believe you can do the same when loading text. 
    Question:  So, how can I load duplicate vendor keys and description into BW using the *_TEXT datasource so they do not overwrite?
    Thanks!

    Hi,
    Don't doubt, it'll work!
    Sys ID as compound to 0Vendor.
    If you doubt about predefined structure of the *_TEXT datasource and direct infosource, then use a flexible infosource. Maybe you'll have to derive the sys ID in a routine or a formula.
    Best regards,
    Eugene

  • Saving and loading 1D array to/from file

    Hi,
    i have some problems with my NI application. for the first, i have case structure with two cases: true and false.
    FALSE: in this case i have a for loop with 100 samples. i catch signal from my DAQ (now just Simulate Signal) and what i want is to save it in a 1D array and at the end of the loop the COMPLETE array into one text file. Problem in my vi: just the values from the last iteration are saved.
    TRUE: now i have while loop. AT THE BEGINN of the loop i need to load my array from the file and not in the middle of the loop. Why? The data from the file are needed during the loop.
    thanx in advance
    Vedran Divkovic
    RUB GERMANY
    Attachments:
    Regelsystem.vi ‏1494 KB

    According to your code, what you are saving is an array of means (one from each iteration), and NOT the last iteration. If you want to keep the entire data, it would be a 2D array.
    Why are you generating an entire waveform at each iteration? Shouldn't you just generate one point?
    LabVIEW Champion . Do more with less code and in less time .

  • How to load date and time from text file to oracle table through sqlloader

    hi friends
    i need you to show me what i miss to load date and time from text file to oracle table through sqlloader
    this is my data in this path (c:\external\my_data.txt)
    7369,SMITH,17-NOV-81,09:14:04,CLERK,20
    7499,ALLEN,01-MAY-81,17:06:08,SALESMAN,30
    7521,WARD,09-JUN-81,17:06:30,SALESMAN,30
    7566,JONES,02-APR-81,09:24:10,MANAGER,20
    7654,MARTIN,28-SEP-81,17:24:10,SALESMAN,30my table in database emp2
    create table emp2 (empno number,
                      ename varchar2(20),
                      hiredate date,
                      etime date,
                      ejob varchar2(20),
                      deptno number);the control file code in this path (c:\external\ctrl.ctl)
    load data
    infile 'C:\external\my_data.txt'
    into table emp2
    fields terminated by ','
    (empno, ename, hiredate, etime, ejob, deptno)this is the error :
    C:\>sqlldr scott/tiger control=C:\external\ctrl.ctl
    SQL*Loader: Release 10.2.0.1.0 - Production on Mon May 31 09:45:10 2010
    Copyright (c) 1982, 2005, Oracle.  All rights reserved.
    Commit point reached - logical record count 5
    C:\>any help i greatly appreciated
    thanks
    Edited by: user10947262 on May 31, 2010 9:47 AM

    load data
    infile 'C:\external\my_data.txt'
    into table emp2
    fields terminated by ','
    (empno, ename, hiredate, etime, ejob, deptno)Try
    load data
    infile 'C:\external\my_data.txt'
    into table emp2
    fields terminated by ','
    (empno, ename, hiredate, etime "to_date(:etime,'hh24:mi:ss')", ejob, deptno)
    this is the error :
    C:\>sqlldr scott/tiger control=C:\external\ctrl.ctl
    SQL*Loader: Release 10.2.0.1.0 - Production on Mon May 31 09:45:10 2010
    Copyright (c) 1982, 2005, Oracle.  All rights reserved.
    Commit point reached - logical record count 5
    C:\>
    That's not an error, you can see errors within log and bad files.

  • How to load Profit Center hierarchy from R3 to BW

    Hi people,
    Sorry, but I already saw some documentations here and I couldn´t solve my problem.
    I need to load Profit Center Hierarchy from R3 to BW.
    I already have the InfoSource 0PROFIT_CTR activated and I would like to know what are the steps to load the "Standard Hierarchy"  that we have in the transaction KCH6N in R3.
    I tried to create the Infopackage based on 0PROFIT_CTR_HIER and when I tryed to schedule, the system asked me the file name to put in the "external data", but I don´t have file to load, I need to load de hierarchy directly from R3.
    Help me please,
    Thanks,
    Rosana.

    U have to activate datasource 0PROFIT_CTR_0106_HIER in R/3 system and replicate that to BW.
    And u should install standard transfer rules (0PROFIT_CTR_0106_HIER  from BI CONTENT) in BW system.
    Create infopackage to load hierarchy.. In Infopackage properties, 'Hierarchy Selection' tab, click 'Available Hierarchies from OLTP' and select ur profit center hierarchy.
    There is no difference loading hierarchy data in BW 3.5 and BI 7.0

  • How to load javafx applciation faster on web page

    Hello,
    Well i have been using javafx for some weeks. I see it is not enough fast for it's loading on a browser. Because just imagine i have a small application on javafx just like the project manager which i put on my webpage. The rest of the content of the webpage loads really quickly but just the project manager loads too slow....I mean there must be some consistency in it's loading with the other content. I really want to know if there can be a piece of code that load the application really quickly??? The difference in the loading of the content of the page and the javafx application should not be shown. The <update check="background"/>... doesnot load it fast.
    Please help

    The update check is, if I understood it correctly, to check if there is an update of the JavaFX runtime. Or perhaps (also?) of the application's jar, with regard to the user's cache.
    The very first time the users load the applet, they have to get the JavaFX runtimes, which is time-consuming, as they are quite large (compared to size of typical applet). Although if you make a game, the applet blows fast as they include assets like images and sounds (Flash applets can load slowly too, because of that).
    Next, the load time will be greatly reduced because the jars will be found in the cache. Unless the users clear it...
    Another latency factor is just the load time of the JVM itself, and of its libraries.
    Currently, I doubt there will be much ways to reduce this time (having a fast server can help...).
    I believe Sun is well aware of this issue and is actively working on it.
    For example, see latest release of Java (1.6.0_18), which curiously is available in [Java SE Downloads|http://java.sun.com/javase/downloads/index.jsp] but not in [Free Java Download|http://www.java.com/en/download/index.jsp] page (where we come from sun.com/java) nor in the automatic updates.
    It [introduces a number of speed improvements|http://java.sun.com/javase/6/webnotes/6u18.html], among them:
    - Better startup of applications and applets on systems where D3D is used.
    - Revised support for pre-verification of FX runtime. Improves warm start of typical FX applications by up to 15 percent. +(not dramatical but that's a step forward)+
    - Concurrent download of jars for webstart applications and applets.
    - Number of other startup improvements for UI applications and applets.
    Some other (unrelated to our issue here) improvements are interesting for JavaFX:
    - Improved performance of applications using translucent windows.
    - Better performance and smaller memory consumption by text rasterizer.
    - Faster processing of PNG images.
    It also adds a number of JWS improvements.
    The concurrent download of jars might be particularly critical for performance improvements of applets using lot of libraries.

  • How to load images in List from Xml and view the image and resize the image & save in Flex?

    Hi Friends,
    I am new to flex i am doing application for image resizing rotating and save the resize image.
    I want to load the images from xml file to listcontrol and show that images as a icon in the listview,then i want to drag that image to panel that time it should show it original size of the Image.then it allows user to resize ,crop,rotate the image.then i want to save the resize image,when i save the resize image it should replace the original image in the xmllist.
    I am looking for some useful suggession ,if you dont mind want to see some snippet code.
    It will help me to understand the concept.
    Cheers,
    B.Venkatesan

    Not in Crystal Reports Basic for Visual Studio 2008. You'll have to upgrade to CR 2008 (12.x). Then use kbase [1320507|http://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/oss_notes_boj/sdn_oss_boj_erq/sap(bD1lbiZjPTAwMQ==)/bc/bsp/spn/scn_bosap/notes.do] as a guide on how to do this.
    Ludek

  • Anyone know how to fill an array faster?

    Hey everyone,
    I created a program which displays an intensity graph, as well as a histogram of the intensity values on a 1024x1024 chip (X-Y dimension). Currently, the program works fine, but the histogram takes FOREVER to complete, and I was wondering if there's a way to increase the speed of this while including all of the 1024x1024=1048576 data points. Thanks!
    Solved!
    Go to Solution.
    Attachments:
    Intensity.JPG ‏89 KB

    Please attach the actual VI. A code image is pretty useless.
    Keep the histogram in a shift register as a 1D array of a sufficient number of elements. In any case, try to autonidex over the 2D array using two stacked FOR loops and built the histogram using the inplace element structure and using the value (Or something derived from it) as index. How many bins do you want? Your values are U16, so using a histogram with 2^16 elements is not out of the question.
    Also don't use express VIs and don't update the graph with every iteration of the inner loop. Indicators belong after the FOR loops.
    Your current shift registers are useless. You get the same value from the iteration terminal, right?
    Why do you reset the histogram at the last iteration of the outer loop, throwing away all data processed until then????
    LabVIEW Champion . Do more with less code and in less time .

  • How to load request by request from DSO to Cube

    Hi All,
    I am loading the data from DSO to Cube. In DSO each request has some 50 lakhs records. When I give execute in the cube transformation after some time it is giving timout error(Basis have set the time till 25 min) and I gave one more option in DTP get all new data request by request but this option also not getting the proper data. Again I am getting the time error.
    If anyone knows any other option please let me know.
    Thanks for your help in advance
    Regards
    Sathiya

    Hi,
    You can load on the criteria of key fields in the DSO.
    Or selecting Fiscal periods may help.
    Hope this helps,
    Regards,
    anil

  • How to load a PNG image from a location in CF card

    Hi,
    I am using WTK 2.5.2. I wanted to load a PNG image to Image object. The image is loaded when I have it in the classes folder. But I want to select different image from a different location. If I try to open an Image to createImage(String) from a different location, I get IOException.
    Please help me.
    Thanks
    Deekshit M

    I got the answer, I should be using Image.createImage(InputStream) API. It works fine.
    Thanks
    DM

  • How to load the existing data from the databse in the CMP entity bean?

    hello
    my problem is as follows--
    i am creating a CMP entity bean.in these beans client create the data instances using create() function.
    now a entity bean will be created for the newly created data and it's EJBObject will also be formed.
    now we will be able to perform finder methods over them.
    remember these data has been newly created in the database.
    but now if i want to perform the finder methods on the
    existing data in the database( i don't need to use create() fn as i am not "creating" the data.). how will i perform the query over the existing data.
    basically i have to make a CMP bean to extract the data corresponding to a particular condition , from the database table. i don't want to create the data in the database but just find out what data satisfies my condition.
    thanking you
    Prashant

    you have to use findByXXX methods. depending on your appserver you may have to declare them (and eventually the query you want to be used) in the vendor specific deploiement descriptor.
    (e.g. using jboss i don't remember having explicitly declare the findBySomeField method - where someField is a persistent field - in the dd, whereas with bas all finder methods have to be explicitly declared)
    [note that obviously these methods have to be present in your home interface]

  • How to load 256 length field from r/3 to BW & How to report in Bex Browser

    Hi,
    We have a field consists of 256 length in r/3 system.
    I want to load from R/3 -> BIW -> Bex Reporting.
    What are the steps to be taken in R/3 Side.
    What are the steps to be taken in BW side.
    What are the steps to be taken for Bex.
    Thanks,
    Madhu

    MAdhu,
    If you want to extract the data from R/3 to BW fro which the field length is 256 then its not possible directly.
    Either you need to breeak up the same filed into 5 Infoobjects since the maximum length of the infoobject is 60 or else you need to maintain a conversion routine... And the remaining process of loading the data from R/3 to BIW is the same.
    Hope this helps...
    Gattu

  • How to load data in HFM from oracle database without FDM

    hi all,
    I want to know that whether we can load data directlyrom oracle database residing on different server without writing the integartion script in FDM.
    points to note:
    we want to load data without using
    1.FDM
    2.Flat file
    3.Excel file or csv or dat file

    The process is described in the EPMA administrator's guide, which you can find in pdf format included in the HFM product documentation. The file name is bpma_admin.pdf. In the case that you have installed HFM (and included EPMA during the installation process), you may find this file in a folder that will look like C:\Hyperion\FinancialManagement\Documentation\en.
    If you do not have installed the products yet, you should bear in mind that all Hyperion product documentation (including HFM) can be downloaded from the e-delivery site of Oracle (http://edelivery.oracle.com). The Hyperion product documentation is a large archive (zip), containing smaller archives per product. The smaller archive you need to open once you download the complete product documentation is the hfm_93100_product_doc.zip.

Maybe you are looking for

  • EXCISE DUTY REDUCTION

    EXCISE DUTY REDUCED FROM 14% TO 10 %.What are the areas where settings has to be changed in SD/MM/FICO.Kindly advise me. Regards A.Prasad

  • Problem in file upload......

    hi i had problem in file upload to server. i gave a absolute path to stored location that is working. but i tried to give relative path of the server that is not working plz help me to this problem.. how to give relative path to Tomcat server...

  • Need still image export in QT Pro 7.7 that opens in Photoshop CS6

    Using Quicktime 7.7 Pro I export a still image from an .avi movie file and choose movie to picture. In options, I am given a choice of various formats including jpeg and png.  But, the file extension still says .pct no matter what format option is ch

  • Re: With Holding tax

    Hi all,       I have an issue relating to with holding tax. wtax code is not picking the percentage ammount while doing the transaction.Please provide the solution. Regards, Suma.

  • InDesign CS3 crash issue

    Hello, One of our corporate users is having an issue where she is able to open or create/modify a file, however whenever she tries to add text and hits the "T" button on the left hand icon menu, the program crashes and shuts down. The error says "InD