title: Flex File reading problem
body: <p>i am having a problem in reading a file from Flex. The file contains a base64encoded string. when i read the file i get the length as 47856 and the decoded base64 byte array length as 34157.</p>
  
  <p>When i read the same File from java i get the length as  48068 and 35733 respectively.</p>
  
  <p>What is the problem?</p>
  
  <pre><code> private function init():void{
          var file:File = File.desktopDirectory.resolvePath("Files/sample.txt");
          stream = new FileStream();
          stream.open(file, FileMode.READ);
          var str:String = stream.readUTFBytes(stream.bytesAvailable);
          stream.close();
          str = str.replace(File.lineEnding, "\n");
          contents.text = str;
          fileName.text = file.name;
      }
  
  
  public function playSound(contents:String):void{
  
  
  
      try{
          var byteData: ByteArray;
  
          byteData = new ByteArray();
          byteData.writeUTFBytes(contents);
          var dec:Base64Decoder = new Base64Decoder();
          dec.decode(contents);
          byteData = dec.toByteArray();
  
  
  
          Alert.show("byte Array   " + byteData.toString().length +" ::  " +contents.length);
  
  
      }
  </code></pre>
  
  <p>And this is my java code for reading the file...Whatever result i am expecting is achieved in the java side.</p>
  
  <pre><code>private static String readFile(String path) throws IOException {  
          FileInputStream stream = new FileInputStream(new File(path)); 
          try {   
              FileChannel fc = stream.getChannel(); 
              MappedByteBuffer bb = fc.map(FileChannel.MapMode.READ_ONLY, 0, fc.size());   
  
              return Charset.defaultCharset().decode(bb).toString();   } 
          finally {     stream.close();   
          } 
      } 
  </code></pre>
  
  <p>Java Code where i am printing the length</p>
  
  <pre><code>byte[] decodedBase64 = new byte[byteLength];
                  String speexData = null;
                  try {
                      speexData =   readFile(userDir +"//" +xmlFileName);
                  } catch (IOException e1) {
                      // TODO Auto-generated catch block
                      e1.printStackTrace();
                  }
  
                  // System.out.println("sa " + sa);
  
                  try{
  
                      decodedBase64=  Base64.decodeToByteArray(speexData);
                      System.out.println("decodednase64 length " + decodedBase64.length +" :: " +speexData.length());
                  }
                  catch(Exception e){
                  }
  </code></pre>