try {
Writer writer = new FileWriter( "test.dat" );
InputStream inputStream =
getClass().getResourceAsStream("./test.resource");
CopyUtils.copy( inputStream, writer );
writer.close();
inputStream.close();
} catch (IOException e) {
System.out.println( "Error copying data" );
}