@Test
public void testWriteBytesFileContext() throws IOException {

  URI uri = tmp.toURI();
  Configuration conf = new Configuration();
  FileContext fc = FileContext.getFileContext(uri, conf);
  Path testPath = new Path(new Path(uri), "writebytes.out");
  byte[] write = new byte[] {0x00, 0x01, 0x02, 0x03};
  FileUtil.write(fc, testPath, write);
  byte[] read = FileUtils.readFileToByteArray(new File(testPath.toUri()));
  assertArrayEquals(write, read);
}