@Override public BufferedSink writeUtf8(String string) throws IOException {
    if (closed) throw new IllegalStateException("closed");
    buffer.writeUtf8(string);
    return emitCompleteSegments();
  }
@Test public void incompleteSegmentsNotEmitted() throws Exception {
    Buffer sink = new Buffer();
    BufferedSink bufferedSink = new RealBufferedSink(sink);
    bufferedSink.writeUtf8(repeat('a', Segment.SIZE * 3 - 1));
    assertEquals(Segment.SIZE * 2, sink.size());
  }