ByteArrayOutputStream streamOut = null;
ByteArrayInputStream streamIn = null;
try {
streamOut = new ByteArrayOutputStream();
resource.save( streamOut, options );
streamIn = new ByteArrayInputStream( streamOut.toByteArray() );
buildFile.create( streamIn, true, monitor );
}
catch ( IOException | CoreException e ) {
// TODO Auto-generated catch block