### Question:
BufferedFileOutput implements RandomAccess, DataOutput, Flushable, Closeable { @Override public void writeBytes(String s) throws IOException { for (int i = 0, n = s.length(); i < n; i++) { writeByte(s.charAt(i)); } } BufferedFileOutput(RandomAccessFile file, int bufferSize);  BufferedFileOutput(RandomAccessFile file, byte[] buffer); void sync(); void seek(long position); long getPosition(); long getSize(); @Override void write(int b); @Override void write(byte[] b); @Override void write(byte[] b, int off, int len); @Override void writeBoolean(boolean v); @Override void writeByte(int v); @Override void writeShort(int v); @Override void writeChar(int v); @Override void writeInt(int v); @Override void writeLong(long v); @Override void writeFloat(float v); @Override void writeDouble(double v); @Override void writeBytes(String s); @Override void writeChars(String s); @Override void writeUTF(String s); @Override void flush(); @Override void close();  }### Answer:
@Test public void testWriteBytes() throws Exception { RandomAccessFile file = file(); BufferedFileOutput buf = manage(new BufferedFileOutput(file, 100)); buf.writeBytes("Hello, world!"); buf.flush(); file.seek(0); byte[] expect = "Hello, world!".getBytes(StandardCharsets.US_ASCII); byte[] b = new byte[expect.length]; file.readFully(b); assertThat(b, is(expect)); eof(file); }