Hi everybody.

I am facing this problem:

I start capturing audio streaming in a wav and when iti s done i need to access the file again, by stream, but when i use openInputStream it throws IOException (File is used by other application)

Here's my code (to be brief i cut exceptions management):

Code:
class Example{
	
	Player player;
	FileConnection file;
	
	public void startRecord(){
		file = (FileConnection)Connector.open("file:///"+name,Connector.READ_WRITE);
		if (!file.exists())
			file.create();
		player = Manager.createPlayer("capture://audio");
		player.realize();
		player.addPlayerListener(this);
		rc = (RecordControl)player.getControl("RecordControl");
		rc.setRecordStream(file.openInputStream());
	    	rc.setRecordSizeLimit(100000);
		player.start();
		rc.startRecord();
	}
	
	
	public void playerUpdate(Player p, String event, Object eventData) {
		if (event.equals(RECORD_STOPPED)) {
        		release();
	        }
	}
	
	public void release() {
		rc.stopRecord();
		rc.commit();
		player.deallocate();
		player.close();
		file.close();
	}

	public InputStream reopen(){
		file = (FileConnection)Connector.open("file:///"+name,Connector.READ);
		return file.openInputStream();
	}
	
}
in detail, if i start recording by startRecord, with the size limit, even when record is done reopen function throws me the IOException

I already tried to close/release both Player and file, but it did not work.
i also tried to set player = null and then call garbage collector...

maybe "release" order is wrong or am i missing anything?