title: How to read data from finger print reader and convert into image file in java
body: <p>i have to read data from finger print reader and convert into image file. I am using Digital Persona 's device U and U 4500 with Platinum SDK . I am  new biometric field. Till now I am only able to detect the device means whether it is connected to system or not.Please guide me what should i do to accomplish this task</p>
  
  <p>i have used this Code(only to check whether device  is working )</p>
  
  <pre><code>import com.digitalpersona.onetouch.DPFPGlobal;
  import com.digitalpersona.onetouch.DPFPSample;
  import com.digitalpersona.onetouch.capture.DPFPCapture; 
  import com.digitalpersona.onetouch.capture.event.DPFPDataEvent;
  import com.digitalpersona.onetouch.capture.event.DPFPDataListener;
  import com.digitalpersona.onetouch.capture.event.DPFPErrorEvent;
  import com.digitalpersona.onetouch.capture.event.DPFPErrorListener;
  import com.digitalpersona.onetouch.capture.event.DPFPReaderStatusAdapter; 
  import com.digitalpersona.onetouch.capture.event.DPFPReaderStatusEvent;
  import com.digitalpersona.onetouch.capture.event.DPFPReaderStatusListener;
  import com.digitalpersona.onetouch.capture.event.DPFPSensorEvent;
  import com.digitalpersona.onetouch.capture.event.DPFPSensorListener;
  
  
  public class Demo {
  public static void main(String args[]){
  //byte[] a=null;
  DPFPCapture capture=DPFPGlobal.getCaptureFactory().createCapture();
  capture.addReaderStatusListener(new DPFPReaderStatusListener() {
  
      @Override
      public void readerDisconnected(DPFPReaderStatusEvent arg0) {
           //TODO Auto-generated method stub
          System.out.println("I m Dis-connected");
  
      }
  
      @Override
      public void readerConnected(DPFPReaderStatusEvent arg0) {
          // TODO Auto-generated method stub
          System.out.println("I m connected");
      }
  });
  capture.addSensorListener(new DPFPSensorListener() {
  
      @Override
      public void imageAcquired(DPFPSensorEvent arg0) {
          // TODO Auto-generated method stub
          System.out.print("acquired");
      }
  
      @Override
      public void fingerTouched(DPFPSensorEvent arg0) {
          // TODO Auto-generated method stub
          System.out.print("s");
      }
  
      @Override
      public void fingerGone(DPFPSensorEvent arg0) {
          // TODO Auto-generated method stub
          System.out.print("gone");
      }
  });
  capture.startCapture();
  capture.addDataListener(new DPFPDataListener() {
  
      @Override
      public void dataAcquired(DPFPDataEvent arg0) {
          // TODO Auto-generated method stub
          DPFPSample sample=DPFPGlobal.getSampleFactory().createSample();
          sample=arg0.getSample();    
          byte a[]=sample.serialize();
          for(byte i:a){
              System.out.print(i);
          }
      }
  });
  capture.addErrorListener(new DPFPErrorListener() {
  
      @Override
      public void exceptionCaught(DPFPErrorEvent arg0) {
          // TODO Auto-generated method stub
          System.out.println("error");
      }
  
      @Override
      public void errorOccured(DPFPErrorEvent arg0) {
          // TODO Auto-generated method stub
          System.out.println("error");
  
      }
  });
  
  }
  }
  </code></pre>