return createFile(fc, path, DEFAULT_NUM_BLOCKS, CreateOpts.donotCreateParent());
}
public static void appendToFile(FileContext fc, Path path, int numBlocks,
CreateOpts... options) throws IOException {
BlockSize blockSizeOpt = CreateOpts.getOpt(CreateOpts.BlockSize.class, options);
long blockSize = blockSizeOpt != null ? blockSizeOpt.getValue()
: DEFAULT_BLOCK_SIZE;
FSDataOutputStream out;
out = fc.create(path, EnumSet.of(CreateFlag.APPEND));
byte[] data = getFileData(numBlocks, blockSize);
out.write(data, 0, data.length);