public static void binToCfile(File binfile) throws IOException {
  int i=0;
  int byte1, byte2;
  InputStream buffy=new BufferedInputStream(new FileInputStream(binfile));
  LittleEndianOutputStream dataOut=new LittleEndianOutputStream(new BufferedOutputStream(new FileOutputStream(binfile.getAbsoluteFile() + ".cfile")));
  while ((byte1=buffy.read()) != -1) {
    if ((byte2=buffy.read()) == -1) {
      dataOut.close();
      break;
    }
    dataOut.writeFloat(((float)byte1 - 127) * 1 / 128);
    dataOut.writeFloat(((float)byte2 - 127) * 1 / 128);
  }
  dataOut.close();
}

public static void binToCfile ( File binfile ) throws IOException { int i = 0 ; int byte1 , byte2 ; InputStream buffy = new BufferedInputStream ( new FileInputStream ( binfile ) ) ; LittleEndianOutputStream dataOut = new LittleEndianOutputStream ( new BufferedOutputStream ( new FileOutputStream ( binfile . getAbsoluteFile ( ) + ".cfile" ) ) ) ; while ( ( byte1 = buffy . read ( ) ) != - 1 ) { if ( ( byte2 = buffy . read ( ) ) == - 1 ) { dataOut . close ( ) ; break ; } dataOut . writeFloat ( ( ( float ) byte1 - 127 ) * 1 / 128 ) ; dataOut . writeFloat ( ( ( float ) byte2 - 127 ) * 1 / 128 ) ; } dataOut . close ( ) ; }
convert a bin file ( capture with rtl_sdr command ) to a readable cfile for airprobe ( gnuradio )
