Read & Write to Buffer an Image

I'm newbie.
I try to program an application(digital image processing). And I want read/write an image from/to buffer (physic memory) or temp file. Is there any one can help ?
Thank you very much!
Sorry about my English.

Hello Trung,
I am very excited to hear that you are interested in using IMAQ Vison for your image application and thank you for using our discussion forums. To answer your question, you certainly can use IMAQ Vision to read from a jpeg or tiff file, run your algorithm for processing the image and then save back your results as an image. Some of the VIs you will need to use are IMAQ ReadFile.vi, IMAQ Write JPEG File.vi and IMAQ Write TIFF File.vi. These VIs can be used to read and write image files. There are some examples included with IMAQ Vision that demonstrate how to use these VIs. One good example on reading image files is ..\Examples\Vision\2. Functions\Analysis\Histogram Example.vi, included as an example under your LabVIEW folder.
For your application you will begin by creating a memory buffer for your image using the IMAQ Create.vi then read the file using IMAQ ReadFile, process the images, save your file and finally deallocate the memory associated with your image using the IMAQ Dispose.vi. The memory allocation, file read, processing and dispose part of this process is shown in the example I mentioned above. For more information about vision concepts refer to the IMAQ Vision Concepts Manual. This is the manual for the newest release of IMAQ Vision 7.1.1, but most of the concepts should apply to your version of Vision.
For information about using the different VIs and functions refer to the IMAQ Vision for LabVIEW User Manual installed on your computer and found under Start>>Programs>>National Instruments>>Vision>>Documentation. I hope this helps you out. If you have more questions I would encourage your to continue using the discussion forums or if you would like one on one assistance from an Applications Engineer contacting your local National Instruments Representative and looking into the IMAQ Vision Standard Service Program (SSP). Have a great day!
Regards,
Nipun M
Applications Engineer
National Instruments

Similar Messages

  • How to read/write image from Microsoft Word

    Hello All,
    I have to replace an image from word(.doc) files.How to read/write images, can any body help me out.
    Thanks in Advance
    Harish Sohane

    harissohane wrote:
    Hi,
    Thanks a lot. if any body knows about it please let me know. waiting for reply.
    Thanks in AdvanceLooking at POI again, it doesn't let you write them, but it does let you read them.
    [A list of API's found in Google in 10 seconds.|http://schmidt.devlib.org/java/libraries-word.html]

  • Cant create/convert image to read/write with Disk Utility

    dear all, because of some reasons, I have to combine files from 2 Recovery DVDs into one, and since the first disc is bootable and have guiding program installed, so my idea is:
    1. Create a read/write image of the first disc
    2. Mount the image
    3. Add files of disk 2 into the image
    I'm using Mac OS X 10.6.6 and Disk Utility is 11.5.2
    My question is:
    No matter I choose "New Image" and select "read/write" to create a new image, or I choose "Convert" and select "read/write" to convert a created image, the results are the same: I still get READ-ONLY image only.
    Is there any trick, or is the version of disk utility got some issues?
    Or is there any other free tool can do so?
    I have Toast 10 and it's image merging functions seemed not working either...
    Thanks all in advance

    If your database version is 11g R2 then you can use active database duplication as Hermant says.
    http://taliphakanozturken.wordpress.com/2011/06/26/creating-standby-database-with-rman-active-database-duplication-in-11gr2/
    Otherwise you need data pump export/import, transportable tablespace, etc to transfer your data.
    Talip Hakan Ozturk
    http://taliphakanozturken.wordpress.com/

  • HT1578 Why is my encrypted disk image now only read only in Mountain Lion? It was fine read/write in Lion.

    Why is my encrypted disk image now only read only in Mountain Lion? It was fine read/write in Lion.
    Sorry post did not give me a choice for the mountain lion community.  Buggy support interface.
    Thanks

    Thanks!  I haven't posted many questions (i guess that's a good thing).  
    I did however find an answer to my issue.  It was caused by a third party utility called Totalfinder.  Once uninstalled and my iMac rebooted, the disk image is behaving to its stated permissions.

  • How to convert read-only disk image to read/write disk image?

    There was some problem with the Mavericks firmware and i keep getting the "white screen of death". I tried the method of backing up Macintosh HD to an external drive via Disk Utility. The problem is I saved it as a compressed file (read-only). I wasn't aware of the problem and went ahead and delete the original Macintosh HD files and set up everything fresh.
    Then when i wanted to back up all my old files from Macintosh HD disk image back up that i created, i can't because the dmg is read-only. I tried to convert it to read/write with disk utility but it couldn't.
    Is there another way to extract the videos and photos? That's all i need.

    A blank empty read only disk image has never been possible. If it's read-only, it cannot be modified, and so it would be blank and empty forever. Not much point in that.
    If you want read-only and encryption on your finished disk image, you'll have to put your files into a folder, and then do File -> New -> Disk image from folder.

  • Read/write disk image vs. sparse

    When I create a new disk image in DU, I am given image format options of read/write disk image, sparse disk image, and sparse bundle disk image.
    I understand the difference between sparse and sparse bundle, but what's read/write?

    A read/write disk image is a traditional (i.e. non-sparse) disk image.
    With sparse images, you define the maximum size, but they only consume as much disk space as the content on the disk image - a 1GB sparse disk image with 50MB of data takes (about) 50MB of space on disk and can grow to 1GB.
    In comparison, a 1GB read/write disk image will consume (about) 1GB on disk, regardless of how much data is on the disk - 1KB, 1MB or 1GB on the image will all consume 1GB on disk.

  • Windows Server 2012 - Hyper-V - iSCSI SAN - All Hyper-V Guests stops responding and extensive disk read/write

    We have a problem with one of our deployments of Windows Server 2012 Hyper-V with a 2 node cluster connected to a iSCSI SAN.
    Our setup:
    Hosts - Both run Windows Server 2012 Standard and are clustered.
    HP ProLiant G7, 24 GB RAM, 2 teamed NIC dedicated to Virtual Machines and Management, 2 teamed NIC dedicated to iSCSI storage. - This is the primary host and normaly all VMs run on this host.
    HP ProLiant G5, 20 GB RAM, 1 NIC dedicated to Virtual Machines and Management, 2 teamed NIC dedicated to iSCSI storage. - This is the secondary host that and is intended to be used in case of failure of the primary host.
    We have no antivirus on the hosts and the scheduled ShadowCopy (previous version of files) is switched of.
    iSCSI SAN:
    QNAP NAS TS-869 Pro, 8 INTEL SSDSA2CW160G3 160 GB i a RAID 5 with a Host Spare. 2 Teamed NIC.
    Switch:
    DLINK DGS-1210-16 - Both the network cards of the Hosts that are dedicated to the Storage and the Storage itself are connected to the same switch and nothing else is connected to this switch.
    Virtual Machines:
    3 Windows Server 2012 Standard - 1 DC, 1 FileServer, 1 Application Server.
    1 Windows Server 2008 Standard Exchange Server.
    All VMs are using dynamic disks (as recommended by Microsoft).
    Updates
    We have applied the most resent updates to the Hosts, WMs and iSCSI SAN about 3 weeks ago with no change in our problem and we continually update the setup.
    Normal operation
    Normally this setup works just fine and we see no real difference in speed in startup, file copy and processing speed in LoB applications of this setup compared to a single host with 2 10000 RPM Disks. Normal network speed is 10-200 Mbit, but occasionally
    we see speeds up to 400 Mbit/s of combined read/write for instance during file repair
    Our Problem
    Our problem is that for some reason all of the VMs stops responding or responds very slowly and you can for instance not send CTRL-ALT-DEL to a VM in the Hyper-V console, or for instance start task manager when already logged in.
    Symptoms (i.e. this happens, or does not happen, at the same time)
    I we look at resource monitor on the host then we see that there is often an extensive read from a VHDX of one of the VMs (40-60 Mbyte/s) and a combined write speed to many files in \HarddiskVolume5\System Volume Information\{<someguid and no file extension>}.
    See iamge below.
    The combined network speed to the iSCSI SAN is about 500-600 Mbit/s.
    When this happens it is usually during and after a VSS ShadowCopy backup, but has also happens during hours where no backup should be running (i.e. during daytime when the backup has finished hours ago according to the log files). There is however
    not that extensive writes to the backup file that is created on an external hard drive and this does not seem to happen during all backups (we have manually checked a few times, but it is hard to say since this error does not seem leave any traces in event
    viewer).
    We cannot find any indication that the VMs themself detect any problem and we see no increase of errors (for example storage related errors) in the eventlog inside the VMs.
    The QNAP uses about 50% processing Power on all cores.
    We see no dropped packets on the switch.
    (I have split the image to save horizontal space).
    Unable to recreate the problem / find definitive trigger
    We have not succeeded in recreating the problem manually by, for instance, running chkdsk or defrag in VM and Hosts, copy and remove large files to VMs, running CPU and Disk intensive operations inside a VM (for instance scan and repair a database file).
    Questions
    Why does all VMs stop responding and why is there such intensive Read/Writes to the iSCSI SAN?
    Could it be anything in our setup that cannot handle all the read/write requests? For instance the iSCSI SAN, the hosts, etc?
    What can we do about this? Should we use MultiPath IO instead of NIC teaming to the SAN, limit bandwith to the SAN, etc?

    Hi,
    > All VMs are using dynamic disks (as recommended by Microsoft).
    If this is a testing environment, it’s okay, but if this a production environment, it’s not recommended. Fixed VHDs are recommended for production instead of dynamically expanding or differencing VHDs.
    Hyper-V: Dynamic virtual hard disks are not recommended for virtual machines that run server workloads in a production environment
    http://technet.microsoft.com/en-us/library/ee941151(v=WS.10).aspx
    > This is the primary host and normaly all VMs run on this host.
    According to your posting, we know that you have Cluster Shared Volumes in the Hyper-V cluster, but why not distribute your VMs into two Hyper-V hosts.
    Use Cluster Shared Volumes in a Windows Server 2012 Failover Cluster
    http://technet.microsoft.com/en-us/library/jj612868.aspx
    > 2 teamed NIC dedicated to iSCSI storage.
    Use Microsoft MultiPath IO (MPIO) to manage multiple paths to iSCSI storage. Microsoft does not support teaming on network adapters that are used to connect to iSCSI-based storage devices. (At least it’s not supported until Windows Server 2008 R2. Although
    Windows Server 2012 has built-in network teaming feature, I don’t article which declare that Windows Server 2012 network teaming support iSCSI connection)
    Understanding Requirements for Failover Clusters
    http://technet.microsoft.com/en-us/library/cc771404.aspx
    > I have seen using MPIO suggests using different subnets, is this a requirement for using MPIO
    > or is this just a way to make sure that you do not run out of IP adressess?
    What I found is: if it is possible, isolate the iSCSI and data networks that reside on the same switch infrastructure through the use of VLANs and separate subnets. Redundant network paths from the server to the storage system via MPIO will maximize availability
    and performance. Of course you can set these two NICs in separate subnets, but I don’t think it is necessary.
    > Why should it be better to not have dedicated wireing for iSCSI and Management?
    It is recommended that the iSCSI SAN network be separated (logically or physically) from the data network workloads. This ‘best practice’ network configuration optimizes performance and reliability.
    Check that and modify cluster configuration, monitor it and give us feedback for further troubleshooting.
    For more information please refer to following MS articles:
    Volume Shadow Copy Service
    http://technet.microsoft.com/en-us/library/ee923636(WS.10).aspx
    Support for Multipath I/O (MPIO)
    http://technet.microsoft.com/en-us/library/cc770294.aspx
    Deployments and Tests in an iSCSI SAN
    http://technet.microsoft.com/en-US/library/bb649502(v=SQL.90).aspx
    Hope this helps!
    TechNet Subscriber Support
    If you are
    TechNet Subscription user and have any feedback on our support quality, please send your feedback
    here.
    Lawrence
    TechNet Community Support

  • How to write to mounted disc image

    I need to add a file to a disc image I created, but it always comes up no write no matter what I do.
    Anyone know a good tip to do this?
    Thanks.

    That sounds excellent, thanks.
    I also found this old tip on Mac OSX Tips. In Terminal type:
    hdiutil attach yourDisc.dmg -shadow /tmp/yourDisc.shadow -noverify
    You can then write to the shadow image, and make a disc image copy of the mounted shadow.
    I think yours is a bit quicker though, but I thought you might enjoy this anyway in a pinch.

  • How to read/write a binary file from/to a table with BLOB column

    I have create a table with a column of data type BLOB.
    I can read/write an IMAGE file from/to the column of the table using:
    READ_IMAGE_FILE
    WRITE_IMAGE_FILE
    How can I do the same for other binary files, e.g. aaaa.zip?

    There is a package procedure dbms_lob.readblobfromfile to read BLOB's from file.
    http://download-east.oracle.com/docs/cd/B19306_01/appdev.102/b14258/d_lob.htm#sthref3583
    To write a BLOB to file you can use a Java procedure (pre Oracle 9i R2) or utl_file.put_raw (there is no dbms_lob.writelobtofile).
    http://asktom.oracle.com/pls/ask/f?p=4950:8:1559124855641433424::NO::F4950_P8_DISPLAYID,F4950_P8_CRITERIA:6379798216275

  • Is there a way to read/write original .xmp settings of a CR2 loaded as smart object onto a .psd layer?

    Hello all. This has been asked in varying degrees before, but many of the discussions I found relative to my question are from the period 2010 to 2013. Thought I would throw this out there again medio 2014 to see if anything new has developed that I'm somehow missing.
    Here's the situation:
    1. In the filesystem, a CR2 file and a sidecar .xmp file with ACR settings applied via Bridge (CS6).
    2. CR2 file is opened in Photoshop (CS6) as a smart object (.xmp sidecar settings are applied in the process).
    3. CR2 file and .xmp now exist on a .psd layer as a smart object...in some unknown form.
    4. File is saved as .psd
    My question is this:
    Is there ANY way at all via Bridge and/or Photoshop scripting to read/write/access/touch/poke/prod the original ACR "development" settings, originally stored in the .xmp sidecar file, that apparently now exist in some form on the smart object layer in the .psd? Via scripting in Bridge, one can alter the metadata on this saved .psd file, no problem, but this is not the same .xmp data that is being referenced by the image loaded as a smart object onto the .psd layer in that file. Where is this second set of data? Can it be accessed?
    Any info, enlightenment would be much appreciated. Thanks.

    No, not too late.
    InDesign is for layout for press in this case.
    Photoshop is for design, which is using the .jpg's.
    I'm half way there, but stuck at:
    Getting a file location reference when the .jpg is first brought into PS as a layer.
    Getting a script to write the location of the file into the medata for the PSD in some field
    Reading back the metadata file location for the .jpg and bringing it back into the PSD again.
    Any help would really be appreciated.
    I can make the completed script(s) available when its complete, as this has possibilities for other uses, batch process, and more.

  • Read/Write pdf's as blobs using forms 10g

    Hi All,
    I have a table called IMAGES in which i store the pdfs as blobs.
    It was successfully working fine with me when I was using forms 6i.
    Recently I installed oracle 10g and just found that 10G doesnt support OLE.
    I came to know about WEBUTIL package and I have already included in the form.
    Could you please help me out how can utilize this WEBUTIL package to read/write blobs from database.
    If you have already developed any code like that, could please forward me?

    The WebUtil_file_transfer.client_to_db and db_to_client will give you direct access to read and write to the blob - I think the Demo form on
    http://www.oracle.com/technology/products/forms/htdocs/webutil/webutil.htm
    has an example of this

  • File transfer, read write through sockets in client server programming java

    Hello All, need help again.
    I am trying to create a Client server program, where, the Client first sends a file to Server, on accepting the file, the server generates another file(probably xml), send it to the client as a response, the client read the response xml, parse it and display some data. now I am successful sending the file to the server, but could not figure out how the server can create and send a xml file and send it to the client as response, please help. below are my codes for client and server
    Client side
    import java.io.BufferedInputStream;
    import java.io.BufferedOutputStream;
    import java.io.BufferedReader;
    import java.io.DataInputStream;
    import java.io.DataOutputStream;
    import java.io.File;
    import java.io.FileInputStream;
    import java.io.FileWriter;
    import java.io.IOException;
    import java.io.InputStreamReader;
    import java.io.PrintWriter;
    import java.net.InetAddress;
    import java.net.Socket;
    import java.net.UnknownHostException;
    public class XMLSocketC
         public static void main(String[] args) throws IOException
              //Establish a connection to socket
              Socket toServer = null;
              String host = "127.0.0.1";     
              int port = 4444;
              try
                   toServer = new Socket(host, port);
                   } catch (UnknownHostException e) {
                System.err.println("Don't know about host: localhost.");
                System.exit(1);
            } catch (IOException e) {
                System.err.println("Couldn't get I/O for the connection to host.");
                System.exit(1);
              //Send file over Socket
            //===========================================================
            BufferedInputStream fileIn = null;
              BufferedOutputStream out = null;
              // File to be send over the socket.
              File file = new File("c:/xampp/htdocs/thesis/sensorList.php");
              // Checking for the file to be sent.
              if (!file.exists())
                   System.out.println("File doesn't exist");
                   System.exit(0);
              try
                   // InputStream to read the file
                   fileIn = new BufferedInputStream(new FileInputStream(file));
              }catch(IOException eee)
                   System.out.println("Problem, kunne ikke lage fil");
              try
                   InetAddress adressen = InetAddress.getByName(host);
                   try
                        System.out.println("Establishing Socket Connection");
                        // Opening Socket
                        Socket s = new Socket(adressen, port);
                        System.out.println("Socket is clear and available.....");
                        // OutputStream to socket
                        out = new BufferedOutputStream(s.getOutputStream());
                        byte[] buffer = new byte[1024];
                        int numRead;
                        //Checking if bytes available to read to the buffer.
                        while( (numRead = fileIn.read(buffer)) >= 0)
                             // Writes bytes to Output Stream from 0 to total number of bytes
                             out.write(buffer, 0, numRead);
                        // Flush - send file
                        out.flush();
                        // close OutputStream
                        out.close();
                        // close InputStrean
                        fileIn.close();
                   }catch (IOException e)
              }catch(UnknownHostException e)
                   System.err.println(e);
            //===========================================================
            //Retrieve data from Socket.
              //BufferedReader in = new BufferedReader(new InputStreamReader(toServer.getInputStream()));
              DataInputStream in = new DataInputStream(new BufferedInputStream(toServer.getInputStream()));
              //String fromServer;
            //Read from the server and prints.
              //Receive text from server
              FileWriter fr = null;
              String frn = "xxx_response.xml";
              try {
                   fr = new FileWriter(frn);
              } catch (IOException e1) {
                   // TODO Auto-generated catch block
                   e1.printStackTrace();
              try{
                   String line = in.readUTF();                    //.readLine();
                   System.out.println("Text received :" + line);
                   fr.write(line);
              } catch (IOException e){
                   System.out.println("Read failed");
                   System.exit(1);
            in.close();
            toServer.close();
    public class XMLSocketS
          public static void main(String[] args) throws IOException
              //Establish a connection to socket
               ServerSocket serverSocket = null;
                 try {
                     serverSocket = new ServerSocket(4444);
                 } catch (IOException e) {
                     System.err.println("Could not listen on port: 4444.");
                     System.exit(1);
              Socket clientLink = null;
              while (true)
                        try
                             clientLink = serverSocket.accept();
                           System.out.println("Server accepts");
                             BufferedInputStream inn = new BufferedInputStream(clientLink.getInputStream());
                             BufferedOutputStream ut = new BufferedOutputStream(new FileOutputStream(new File("c:/xampp/htdocs/received_from_client.txt")));
                             byte[] buff = new byte[1024];
                             int readMe;
                             while( (readMe = inn.read(buff)) >= 0)
                             {     //reads from input stream, writes the file to disk
                                  ut.write(buff, 0, readMe);
                             // close the link to client
                             clientLink.close();                         
                             // close InputStream
                             inn.close();                         
                             // flush
                             ut.flush();                         
                             // close OutputStream
                             ut.close();     
                             //Sending response to client     
                             //============================================================
                             //============================================================
                             System.out.println("File received");
              }catch(IOException ex)
              {System.out.println("Exception.");}
                        finally
                             try
                                  if (clientLink != null) clientLink.close();
                             }catch(IOException e) {}
                 clientLink.close();
                 //serverSocket.close();
    }

    SERVER
    import java.net.*;
    import java.io.*;
    public class XMLSocketS
          public static void main(String[] args) throws IOException
                   //Establish a connection to socket
               ServerSocket serverSocket = null;
                 try {
                     serverSocket = new ServerSocket(4545);
                 } catch (IOException e) {
                     System.err.println("Could not listen on port: 4444.");
                     System.exit(1);
              Socket clientLink = null;
                  try
                             clientLink = serverSocket.accept();
                         System.out.println("Server accepts the client request.....");
                         BufferedInputStream inn = new BufferedInputStream(clientLink.getInputStream());
                             BufferedOutputStream ut = new BufferedOutputStream(new FileOutputStream(new File("c:/xampp/htdocs/received_from_client.txt")));
                             byte[] buff = new byte[1024];
                             int readMe;
                             while( (readMe = inn.read(buff)) >= 0)
                             {     //reads from input stream, writes the file to disk
                                  ut.write(buff, 0, readMe);
                             ut.flush();                         
                             //Sending response to client     
                             //============================================================
                             BufferedInputStream ftoC = null;
                             BufferedOutputStream outtoC = null;
                             // File to be send over the socket.
                             File file = new File("c:/xampp/htdocs/thesis/user_registration_response.xml");
                             try
                                  // InputStream to read the file
                                   ftoC = new BufferedInputStream(new FileInputStream(file));
                             }catch(IOException eee)
                             {System.out.println("Problem reading file");}
                             // OutputStream to socket
                             outtoC = new BufferedOutputStream(clientLink.getOutputStream());
                             byte[] buffer = new byte[1024];
                             int noRead;
                             //Checking if bytes available to read to the buffer.
                             while( (noRead = ftoC.read(buffer)) >= 0)
                                  // Writes bytes to Output Stream from 0 to total number of bytes
                                  outtoC.write(buffer, 0, noRead);
                             outtoC.flush();
                             //============================================================
                             System.out.println("File received");
              }catch(IOException ex)
              {System.out.println("Exception.");}
                        finally
                             try
                                  if (clientLink != null) clientLink.close();
                             }catch(IOException e) {}
                 clientLink.close();
                 //serverSocket.close();
          }CLIENT SIDE
    import java.io.*;
    import java.net.*;
    public class XMLSocketC
              @SuppressWarnings("deprecation")
              public static void main(String[] args)
                   // Server: "localhost" here. And port to connect is 4545.
                   String host = "127.0.0.1";          
                   int port = 4545;
                   BufferedInputStream fileIn = null;
                   BufferedOutputStream out = null;
                   // File to be send over the socket.
                   File file = new File("c:/xampp/htdocs/thesis/sensorList.xml");
                   try
                        // InputStream to read the file
                        fileIn = new BufferedInputStream(new FileInputStream(file));
                   }catch(IOException eee)
                   {System.out.println("Problem");}
                   try
                             System.out.println("Establishing Socket Connection");
                             // Opening Socket
                             Socket clientSocket = new Socket(host, port);
                             System.out.println("Socket is clear and available.....");
                             // OutputStream to socket
                             out = new BufferedOutputStream(clientSocket.getOutputStream());
                             byte[] buffer = new byte[1024];
                             int numRead;
                             //Checking if bytes available to read to the buffer.
                             while( (numRead = fileIn.read(buffer)) >= 0)
                                  // Writes bytes to Output Stream from 0 to total number of bytes
                                  out.write(buffer, 0, numRead);
                             // Flush - send file
                             out.flush();
                             //=======================================
                             DataInputStream in = new DataInputStream(new BufferedInputStream(clientSocket.getInputStream()));
                             BufferedWriter outf = new BufferedWriter(new FileWriter("c:/xampp/htdocs/received_from_server.txt",true));
                             String str;
                             while(!(str = in.readLine()).equals("EOF")) {     
                                  System.out.println("client : Read line -> <" + str + ">");
                                  outf.write(str);//Write out a string to the file
                                  outf.newLine();//write a new line to the file (for better format)
                                  outf.flush();
                             //=======================================
                             // close OutputStream
                             out.close();
                             // close InputStrean
                             fileIn.close();
                             // close Socket
                             clientSocket.close();
                        }catch (IOException e)
                        {System.out.println("Exception.");}
         Could you please point where am I doing the stupid mistake, client to server is working properly, but the opposite direction is not.
    Thanks

  • Asynchronous read & write by using Asynchronous api provided in nio-java 7

    HI,
    I am trying to write a small program to implement **asynchronous read & write by using Asynchronous api provided in nio in java 1.7** in windows machine.
    i tried the following code to write a small string to a file asynchronously.file is getting created but the contents are not dispalying.
         static long startTime = System.currentTimeMillis();
         static long endTime;
         static long execTime;
         public static void main(String[] args) {
              String path = "C:\\AsynchWrite.txt";
              Path file = Paths.get(path);
              final AsynchronousFileChannel channel;
              long pos = 1;
              try {
                   OpenOption[] options = { StandardOpenOption.CREATE,
                             StandardOpenOption.WRITE, StandardOpenOption.SYNC };
                   channel = AsynchronousFileChannel.open(file, options);
                   ByteBuffer buffer = ByteBuffer.allocate(1000);
                   String writeThis = "Testing by writing a line";
                   byte[] src = writeThis.getBytes();
                   buffer.put(src);
                   channel.write(buffer, pos, null,
                             new CompletionHandler<Integer, Object>() {
                                  @Override
                                  public void completed(Integer result, Object attachment) {
                                       System.out.println("completed successfully");
                                       System.out.println("start time :" + startTime);
                                       endTime = System.currentTimeMillis();
                                       System.out.println("end time : " + endTime);
                                       execTime = endTime - startTime;
                                       System.out.println("Execution Time :" + execTime);
                                       System.out.println("Execution Time(ms) :"
                                                 + execTime);
                                       try {
                                            channel.force(true);
                                            channel.close();
                                       } catch (IOException e) {
                                            // TODO Auto-generated catch block
                                            e.printStackTrace();
                                  @Override
                                  public void failed(Throwable exc, Object attachment) {
                                       // TODO Auto-generated method stub
                                       System.out.println("failed!!");
              } catch (IOException e) {
                   // TODO Auto-generated catch block
                   e.printStackTrace();
         }Please help me out
    Thanks in advance,
    Ravi

    It looks like you are missing buffer.flip() after your put as otherwise the buffer position will be at 25 (not 0 as you expect).

  • IO Operation (read/write files) in IPAD AIR downgrade ~50% than the one in IPAD4

    Summary:
    UnZip the same file with the same native unzip method (native zlib) in IOS7, ipad air take +50% more time consumption than the one in iPAD4.
    for unZip, it main perform the IO read/write files in ipad, does apple air already changes the file system ?
    Steps to Reproduce:
    UnZIP a file with native zlip on both ipad AIR and IPAD 4 :
    IPAD AIR: 16GB
    IPAD 4: 16GB
    ZIP file size: 700KB
    Files in zip file: 225 files (120 files are images)
      after remove the images, the time on IPAD AIR will save 50% time consumption
    unZip method: the native zlib
    unzip time on IPAD AIR+ IOS7: ~1200ms
    unzip time on IPAD 4+ IOS7: ~800ms
    Expected Results:
    The unzip time should be almost the same on IPAD AIR and IPAD4.
    Actual Results:
    For same IO operation read/write file, IPAD AIR gets the 50% downgrade performance than the one in IPAD4
    Version:
    IPAD4: 16GB WIFI + IOS7
    IPAD AIR: 16GB WIFI + IOS7
    does anyone else encounter the same problem ?
    A bug already submitted for apple: https://devforums.apple.com/message/993060

    I even tried porting the code to Gumbo and running it there - still, no fonts are being enumerated.
    If you're too lazy to read the whole above post, here's the problem in one sentence
    An SWF that contains a textfield with embedded fonts, when launched by itself succeeds to return the embedded font using Font.enumerateFonts(false), however when loaded using Loader.loadBytes into AIR, it fails to see those fonts even though the textfield in it is displayed and editable.
    How do I make the loaded child application and AIR see the embedded font?

  • Can't open iPhoto (can't read/write)

    Hi all,
    I had a hard drive meltdown on Sunday and the drive had to be replaced. iPhoto 7.1.2 was installed on my machine at that time (I've been using iPhoto for, oh, at least three years now) and then I got on a plane to Israel which is where I am for the next 2 months (no Apple stores in the whole country!)
    I can't open iPhoto. When I click on the icon, nothing happens. I went to iPhoto info (by opening up Applications in the three-tiered view and clicking on "more info") and I see that the setting is set as: "Ownership and Permissions" and then "you can: [read/write]" is greyed-out.
    More details: beneath that, it says: "Owner: [system]" (the name "system" is also greyed-out) and there's a little padlock icon next to that.
    Can anyone here help me figure out how to get iPhoto to launch? The file is 174.2 MB, so clearly the program exists on my machine; I just can't get it to open. Thanks!
    Message was edited by: rbarenblat

    Host Name: rachel-barenblats-computer
    Date/Time: 2008-06-24 19:44:58.131 +0300
    OS Version: 10.4.11 (Build 8S2167)
    Report Version: 4
    Command: iPhoto
    Path: /Applications/iPhoto.app/Contents/MacOS/iPhoto
    Parent: WindowServer [147]
    Version: 7.1.2 (7.1.2)
    PID: 976
    Thread: Unknown
    Link (dyld) error:
    Library not loaded: /System/Library/PrivateFrameworks/GraphicsAppSupport.framework/Versions/A/Frame works/ImageKit.framework/Versions/A/ImageKit
    Referenced from: /System/Library/PrivateFrameworks/iLifeMediaBrowser.framework/Versions/A/iLifeM ediaBrowser
    Reason: image not found
    Host Name: rachel-barenblats-computer
    Date/Time: 2008-06-24 19:45:11.851 +0300
    OS Version: 10.4.11 (Build 8S2167)
    Report Version: 4
    Command: iPhoto
    Path: /Applications/iPhoto.app/Contents/MacOS/iPhoto
    Parent: WindowServer [147]
    Version: 7.1.2 (7.1.2)
    PID: 978
    Thread: Unknown
    Link (dyld) error:
    Library not loaded: /System/Library/PrivateFrameworks/GraphicsAppSupport.framework/Versions/A/Frame works/ImageKit.framework/Versions/A/ImageKit
    Referenced from: /System/Library/PrivateFrameworks/iLifeMediaBrowser.framework/Versions/A/iLifeM ediaBrowser
    Reason: image not found
    Host Name: rachel-barenblats-computer
    Date/Time: 2008-06-24 19:45:14.639 +0300
    OS Version: 10.4.11 (Build 8S2167)
    Report Version: 4
    Command: iPhoto
    Path: /Applications/iPhoto.app/Contents/MacOS/iPhoto
    Parent: WindowServer [147]
    Version: 7.1.2 (7.1.2)
    PID: 980
    Thread: Unknown
    Link (dyld) error:
    Library not loaded: /System/Library/PrivateFrameworks/GraphicsAppSupport.framework/Versions/A/Frame works/ImageKit.framework/Versions/A/ImageKit
    Referenced from: /System/Library/PrivateFrameworks/iLifeMediaBrowser.framework/Versions/A/iLifeM ediaBrowser
    Reason: image not found
    Host Name: rachel-barenblats-computer
    Date/Time: 2008-06-24 19:45:31.564 +0300
    OS Version: 10.4.11 (Build 8S2167)
    Report Version: 4
    Command: iPhoto
    Path: /Applications/iPhoto.app/Contents/MacOS/iPhoto
    Parent: WindowServer [147]
    Version: 7.1.2 (7.1.2)
    PID: 982
    Thread: Unknown
    Link (dyld) error:
    Library not loaded: /System/Library/PrivateFrameworks/GraphicsAppSupport.framework/Versions/A/Frame works/ImageKit.framework/Versions/A/ImageKit
    Referenced from: /System/Library/PrivateFrameworks/iLifeMediaBrowser.framework/Versions/A/iLifeM ediaBrowser
    Reason: image not found
    Host Name: rachel-barenblats-computer
    Date/Time: 2008-06-24 19:46:04.503 +0300
    OS Version: 10.4.11 (Build 8S2167)
    Report Version: 4
    Command: iPhoto
    Path: /Applications/iPhoto.app/Contents/MacOS/iPhoto
    Parent: WindowServer [147]
    Version: 7.1.2 (7.1.2)
    PID: 985
    Thread: Unknown
    Link (dyld) error:
    Library not loaded: /System/Library/PrivateFrameworks/GraphicsAppSupport.framework/Versions/A/Frame works/ImageKit.framework/Versions/A/ImageKit
    Referenced from: /System/Library/PrivateFrameworks/iLifeMediaBrowser.framework/Versions/A/iLifeM ediaBrowser
    Reason: image not found
    Host Name: rachel-barenblats-computer
    Date/Time: 2008-06-24 19:46:43.010 +0300
    OS Version: 10.4.11 (Build 8S2167)
    Report Version: 4
    Command: iPhoto
    Path: /Applications/iPhoto.app/Contents/MacOS/iPhoto
    Parent: WindowServer [147]
    Version: 7.1.2 (7.1.2)
    PID: 988
    Thread: Unknown
    Link (dyld) error:
    Library not loaded: /System/Library/PrivateFrameworks/GraphicsAppSupport.framework/Versions/A/Frame works/ImageKit.framework/Versions/A/ImageKit
    Referenced from: /System/Library/PrivateFrameworks/iLifeMediaBrowser.framework/Versions/A/iLifeM ediaBrowser
    Reason: image not found
    Host Name: rachel-barenblats-computer
    Date/Time: 2008-06-24 19:47:27.244 +0300
    OS Version: 10.4.11 (Build 8S2167)
    Report Version: 4
    Command: iPhoto
    Path: /Applications/iPhoto.app/Contents/MacOS/iPhoto
    Parent: WindowServer [147]
    Version: 7.1.2 (7.1.2)
    PID: 993
    Thread: Unknown
    Link (dyld) error:
    Library not loaded: /System/Library/PrivateFrameworks/GraphicsAppSupport.framework/Versions/A/Frame works/ImageKit.framework/Versions/A/ImageKit
    Referenced from: /System/Library/PrivateFrameworks/iLifeMediaBrowser.framework/Versions/A/iLifeM ediaBrowser
    Reason: image not found
    Host Name: rachel-barenblats-computer
    Date/Time: 2008-06-24 19:48:44.677 +0300
    OS Version: 10.4.11 (Build 8S2167)
    Report Version: 4
    Command: iPhoto
    Path: /Applications/iPhoto.app/Contents/MacOS/iPhoto
    Parent: WindowServer [147]
    Version: 7.1.2 (7.1.2)
    PID: 997
    Thread: Unknown
    Link (dyld) error:
    Library not loaded: /System/Library/PrivateFrameworks/GraphicsAppSupport.framework/Versions/A/Frame works/ImageKit.framework/Versions/A/ImageKit
    Referenced from: /System/Library/PrivateFrameworks/iLifeMediaBrowser.framework/Versions/A/iLifeM ediaBrowser
    Reason: image not found
    Host Name: rachel-barenblats-computer
    Date/Time: 2008-06-24 19:48:58.871 +0300
    OS Version: 10.4.11 (Build 8S2167)
    Report Version: 4
    Command: iPhoto
    Path: /Applications/iPhoto.app/Contents/MacOS/iPhoto
    Parent: WindowServer [147]
    Version: 7.1.2 (7.1.2)
    PID: 999
    Thread: Unknown
    Link (dyld) error:
    Library not loaded: /System/Library/PrivateFrameworks/GraphicsAppSupport.framework/Versions/A/Frame works/ImageKit.framework/Versions/A/ImageKit
    Referenced from: /System/Library/PrivateFrameworks/iLifeMediaBrowser.framework/Versions/A/iLifeM ediaBrowser
    Reason: image not found
    Host Name: rachel-barenblats-computer
    Date/Time: 2008-06-24 19:52:21.929 +0300
    OS Version: 10.4.11 (Build 8S2167)
    Report Version: 4
    Command: iPhoto
    Path: /Applications/iPhoto.app/Contents/MacOS/iPhoto
    Parent: WindowServer [147]
    Version: 7.1.2 (7.1.2)
    PID: 1010
    Thread: Unknown
    Link (dyld) error:
    Library not loaded: /System/Library/PrivateFrameworks/GraphicsAppSupport.framework/Versions/A/Frame works/ImageKit.framework/Versions/A/ImageKit
    Referenced from: /System/Library/PrivateFrameworks/iLifeMediaBrowser.framework/Versions/A/iLifeM ediaBrowser
    Reason: image not found
    Host Name: rachel-barenblats-computer
    Date/Time: 2008-06-24 19:52:30.676 +0300
    OS Version: 10.4.11 (Build 8S2167)
    Report Version: 4
    Command: iPhoto
    Path: /Applications/iPhoto.app/Contents/MacOS/iPhoto
    Parent: WindowServer [147]
    Version: 7.1.2 (7.1.2)
    PID: 1012
    Thread: Unknown
    Link (dyld) error:
    Library not loaded: /System/Library/PrivateFrameworks/GraphicsAppSupport.framework/Versions/A/Frame works/ImageKit.framework/Versions/A/ImageKit
    Referenced from: /System/Library/PrivateFrameworks/iLifeMediaBrowser.framework/Versions/A/iLifeM ediaBrowser
    Reason: image not found
    Host Name: rachel-barenblats-computer
    Date/Time: 2008-06-24 19:56:56.044 +0300
    OS Version: 10.4.11 (Build 8S2167)
    Report Version: 4
    Command: iPhoto
    Path: /Applications/iPhoto.app/Contents/MacOS/iPhoto
    Parent: WindowServer [147]
    Version: 7.1.2 (7.1.2)
    PID: 1017
    Thread: Unknown
    Link (dyld) error:
    Library not loaded: /System/Library/PrivateFrameworks/GraphicsAppSupport.framework/Versions/A/Frame works/ImageKit.framework/Versions/A/ImageKit
    Referenced from: /System/Library/PrivateFrameworks/iLifeMediaBrowser.framework/Versions/A/iLifeM ediaBrowser
    Reason: image not found
    Host Name: rachel-barenblats-computer
    Date/Time: 2008-06-24 19:56:58.107 +0300
    OS Version: 10.4.11 (Build 8S2167)
    Report Version: 4
    Command: iPhoto
    Path: /Applications/iPhoto.app/Contents/MacOS/iPhoto
    Parent: WindowServer [147]
    Version: 7.1.2 (7.1.2)
    PID: 1019
    Thread: Unknown
    Link (dyld) error:
    Library not loaded: /System/Library/PrivateFrameworks/GraphicsAppSupport.framework/Versions/A/Frame works/ImageKit.framework/Versions/A/ImageKit
    Referenced from: /System/Library/PrivateFrameworks/iLifeMediaBrowser.framework/Versions/A/iLifeM ediaBrowser
    Reason: image not found
    Host Name: rachel-barenblats-computer
    Date/Time: 2008-06-24 20:20:23.221 +0300
    OS Version: 10.4.11 (Build 8S2167)
    Report Version: 4
    Command: iPhoto
    Path: /Applications/iPhoto.app/Contents/MacOS/iPhoto
    Parent: WindowServer [147]
    Version: 7.1.2 (7.1.2)
    PID: 1035
    Thread: Unknown
    Link (dyld) error:
    Library not loaded: /System/Library/PrivateFrameworks/GraphicsAppSupport.framework/Versions/A/Frame works/ImageKit.framework/Versions/A/ImageKit
    Referenced from: /System/Library/PrivateFrameworks/iLifeMediaBrowser.framework/Versions/A/iLifeM ediaBrowser
    Reason: image not found
    Host Name: rachel-barenblats-computer
    Date/Time: 2008-06-24 20:20:35.972 +0300
    OS Version: 10.4.11 (Build 8S2167)
    Report Version: 4
    Command: iPhoto
    Path: /Applications/iPhoto.app/Contents/MacOS/iPhoto
    Parent: WindowServer [147]
    Version: 7.1.2 (7.1.2)
    PID: 1037
    Thread: Unknown
    Link (dyld) error:
    Library not loaded: /System/Library/PrivateFrameworks/GraphicsAppSupport.framework/Versions/A/Frame works/ImageKit.framework/Versions/A/ImageKit
    Referenced from: /System/Library/PrivateFrameworks/iLifeMediaBrowser.framework/Versions/A/iLifeM ediaBrowser
    Reason: image not found
    Host Name: rachel-barenblats-computer
    Date/Time: 2008-06-24 20:20:48.250 +0300
    OS Version: 10.4.11 (Build 8S2167)
    Report Version: 4
    Command: iPhoto
    Path: /Applications/iPhoto.app/Contents/MacOS/iPhoto
    Parent: WindowServer [147]
    Version: 7.1.2 (7.1.2)
    PID: 1039
    Thread: Unknown
    Link (dyld) error:
    Library not loaded: /System/Library/PrivateFrameworks/GraphicsAppSupport.framework/Versions/A/Frame works/ImageKit.framework/Versions/A/ImageKit
    Referenced from: /System/Library/PrivateFrameworks/iLifeMediaBrowser.framework/Versions/A/iLifeM ediaBrowser
    Reason: image not found
    Host Name: rachel-barenblats-computer
    Date/Time: 2008-06-25 09:09:18.463 +0300
    OS Version: 10.4.11 (Build 8S2167)
    Report Version: 4
    Command: iPhoto
    Path: /Applications/iPhoto.app/Contents/MacOS/iPhoto
    Parent: WindowServer [147]
    Version: 7.1.2 (7.1.2)
    PID: 1180
    Thread: Unknown
    Link (dyld) error:
    Library not loaded: /System/Library/PrivateFrameworks/GraphicsAppSupport.framework/Versions/A/Frame works/ImageKit.framework/Versions/A/ImageKit
    Referenced from: /System/Library/PrivateFrameworks/iLifeMediaBrowser.framework/Versions/A/iLifeM ediaBrowser
    Reason: image not found
    Host Name: rachel-barenblats-computer
    Date/Time: 2008-06-25 09:35:51.810 +0300
    OS Version: 10.4.11 (Build 8S2167)
    Report Version: 4
    Command: iPhoto
    Path: /Applications/iPhoto.app/Contents/MacOS/iPhoto
    Parent: WindowServer [147]
    Version: 7.1.2 (7.1.2)
    PID: 1191
    Thread: Unknown
    Link (dyld) error:
    Library not loaded: /System/Library/PrivateFrameworks/GraphicsAppSupport.framework/Versions/A/Frame works/ImageKit.framework/Versions/A/ImageKit
    Referenced from: /System/Library/PrivateFrameworks/iLifeMediaBrowser.framework/Versions/A/iLifeM ediaBrowser
    Reason: image not found
    Host Name: rachel-barenblats-computer
    Date/Time: 2008-06-25 12:06:14.762 +0300
    OS Version: 10.4.11 (Build 8S2167)
    Report Version: 4
    Command: iPhoto
    Path: /Applications/iPhoto.app/Contents/MacOS/iPhoto
    Parent: WindowServer [147]
    Version: 7.1.2 (7.1.2)
    PID: 1428
    Thread: Unknown
    Link (dyld) error:
    Library not loaded: /System/Library/PrivateFrameworks/GraphicsAppSupport.framework/Versions/A/Frame works/ImageKit.framework/Versions/A/ImageKit
    Referenced from: /System/Library/PrivateFrameworks/iLifeMediaBrowser.framework/Versions/A/iLifeM ediaBrowser
    Reason: image not found
    Host Name: rachel-barenblats-computer
    Date/Time: 2008-06-25 14:58:40.631 +0300
    OS Version: 10.4.11 (Build 8S2167)
    Report Version: 4
    Command: iPhoto
    Path: /Applications/iPhoto.app/Contents/MacOS/iPhoto
    Parent: WindowServer [147]
    Version: 7.1.2 (7.1.2)
    PID: 1534
    Thread: Unknown
    Link (dyld) error:
    Library not loaded: /System/Library/PrivateFrameworks/GraphicsAppSupport.framework/Versions/A/Frame works/ImageKit.framework/Versions/A/ImageKit
    Referenced from: /System/Library/PrivateFrameworks/iLifeMediaBrowser.framework/Versions/A/iLifeM ediaBrowser
    Reason: image not found
    Host Name: rachel-barenblats-computer
    Date/Time: 2008-06-25 14:58:56.845 +0300
    OS Version: 10.4.11 (Build 8S2167)
    Report Version: 4
    Command: iPhoto
    Path: /Applications/iPhoto.app/Contents/MacOS/iPhoto
    Parent: WindowServer [147]
    Version: 7.1.2 (7.1.2)
    PID: 1536
    Thread: Unknown
    Link (dyld) error:
    Library not loaded: /System/Library/PrivateFrameworks/GraphicsAppSupport.framework/Versions/A/Frame works/ImageKit.framework/Versions/A/ImageKit
    Referenced from: /System/Library/PrivateFrameworks/iLifeMediaBrowser.framework/Versions/A/iLifeM ediaBrowser
    Reason: image not found
    Host Name: rachel-barenblats-computer
    Date/Time: 2008-06-25 14:59:56.529 +0300
    OS Version: 10.4.11 (Build 8S2167)
    Report Version: 4
    Command: iPhoto
    Path: /Applications/iPhoto.app/Contents/MacOS/iPhoto
    Parent: WindowServer [147]
    Version: 7.1.2 (7.1.2)
    PID: 1540
    Thread: Unknown
    Link (dyld) error:
    Library not loaded: /System/Library/PrivateFrameworks/GraphicsAppSupport.framework/Versions/A/Frame works/ImageKit.framework/Versions/A/ImageKit
    Referenced from: /System/Library/PrivateFrameworks/iLifeMediaBrowser.framework/Versions/A/iLifeM ediaBrowser
    Reason: image not found
    Host Name: rachel-barenblats-computer
    Date/Time: 2008-06-25 15:28:46.623 +0300
    OS Version: 10.4.11 (Build 8S2167)
    Report Version: 4
    Command: iPhoto
    Path: /Applications/iPhoto.app/Contents/MacOS/iPhoto
    Parent: WindowServer [147]
    Version: 7.1.2 (7.1.2)
    PID: 1560
    Thread: Unknown
    Link (dyld) error:
    Library not loaded: /System/Library/PrivateFrameworks/GraphicsAppSupport.framework/Versions/A/Frame works/ImageKit.framework/Versions/A/ImageKit
    Referenced from: /System/Library/PrivateFrameworks/iLifeMediaBrowser.framework/Versions/A/iLifeM ediaBrowser
    Reason: image not found
    Host Name: rachel-barenblats-computer
    Date/Time: 2008-06-25 15:39:28.665 +0300
    OS Version: 10.4.11 (Build 8S2167)
    Report Version: 4
    Command: iPhoto
    Path: /Applications/iPhoto.app/Contents/MacOS/iPhoto
    Parent: WindowServer [147]
    Version: 7.1.2 (7.1.2)
    PID: 1572
    Thread: Unknown
    Link (dyld) error:
    Library not loaded: /System/Library/PrivateFrameworks/GraphicsAppSupport.framework/Versions/A/Frame works/ImageKit.framework/Versions/A/ImageKit
    Referenced from: /System/Library/PrivateFrameworks/iLifeMediaBrowser.framework/Versions/A/iLifeM ediaBrowser
    Reason: image not found

Maybe you are looking for

  • There's something wrong with my iphone 4s

    So there's something wrong with my iPhone 4s. Just recently it worked fine and all of a sudden it started going insane so what I did was turn my phone off for five minutes then back on. When I did my imessage won't work nor does my app called Line wo

  • How to get mms for unlocked iphone?

    just got the unlocked iphone but the picture mail isnt working how do i enable that? i am using it for Tmobile carrier.

  • How can I use a file in Eclipse?

    Hi mates, I dnt know how I can use Eclipse to operate a file, like the sample input file. I try to set a file name in "Argument" tab and create a file in the project, but it 's not working. CHEERS, Elton

  • Reader X issues for PDFs embedded in web page

    I've just upgraded to Reader X. I subscribe to a private genealogy web site which has PDFs embedded in the pages. I have two issues with this: 1. Some of the PDFs have links. Whenever a link is in the same place on the page as the floating toolbar, t

  • Do I need to have .businesscatalyst in the URL of a site I create with Muse? If no, how do I manage that?

    I am creating a single landing page for the company I work for. The tech team is swamped, and is unavailable to assist. I don't want to have the .businesscatalyst name in the URL. Is that possible if I host with Adobe?