code: public int close()
  	{
  		int retcode = DDC_SUCCESS;
  
  		switch (fmode)
  		{
  			case RFM_WRITE:
  				try
  				{
  					file.seek(0);
  					try
  					{
  						writeHeader_internally(riff_header);
  						file.close();
  					}
  					catch (IOException ioe)
  					{
  						retcode = DDC_FILE_ERROR;
  					}
  				}
  				catch (IOException ioe)
  				{
  					retcode = DDC_FILE_ERROR;
  				}
  				break;
  
  			case RFM_READ:
  				try
  				{
  					file.close();
  				}
  				catch (IOException ioe)
  				{
  					retcode = DDC_FILE_ERROR;
  				}
  				break;
  		}
  		file = null;
  		fmode = RFM_UNKNOWN;
  		return retcode;
  	}
docs: Close Riff File.
  Length is written too.