class BufferedElementCountingOutputStream extends OutputStream {

  public void markElementStart() throws IOException {
    if (finished) {
      throw new IOException("Stream has been finished. Can not add any more elements.");
    }
    count++;
  }

  public  BufferedElementCountingOutputStream(OutputStream os);
  public  BufferedElementCountingOutputStream(OutputStream os, long terminatorValue);
    BufferedElementCountingOutputStream(OutputStream os, int bufferSize, long terminatorValue);

}