@Test public void testWrite() throws Exception { RandomAccessFile file = file(); BufferedFileOutput buf = manage(new BufferedFileOutput(file, 100)); for (int i = 0; i < 256; i++) { buf.write(i); assertThat(buf.getPosition(), is(i + 1L)); assertThat(buf.getSize(), is(i + 1L)); } buf.flush(); file.seek(0); for (int i = 0; i < 256; i++) { assertThat(file.readByte(), is((byte) i)); } eof(file); }
@Override public void write(int b) throws IOException { write0(b); }
BufferedFileOutput implements RandomAccess, DataOutput, Flushable, Closeable { @Override public void write(int b) throws IOException { write0(b); } }
BufferedFileOutput implements RandomAccess, DataOutput, Flushable, Closeable { @Override public void write(int b) throws IOException { write0(b); } BufferedFileOutput(RandomAccessFile file, int bufferSize);  BufferedFileOutput(RandomAccessFile file, byte[] buffer); }
BufferedFileOutput implements RandomAccess, DataOutput, Flushable, Closeable { @Override public void write(int b) throws IOException { write0(b); } 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(); }
BufferedFileOutput implements RandomAccess, DataOutput, Flushable, Closeable { @Override public void write(int b) throws IOException { write0(b); } 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();  }