code: private synchronized void addBookKeeperEntry(byte[] buf, int off, int len)
        throws IOException {
      try {
        ledger.addEntry(buf, off, len);
        if (LOG.isDebugEnabled()) {
          LOG.debug("Last add pushed to ledger " + ledger.getId() + " is " +
              ledger.getLastAddPushed());
          LOG.debug("Last add confirmed to ledger " + ledger.getId() + " is " +
              ledger.getLastAddConfirmed());
        }
      } catch (InterruptedException e) {
        Thread.currentThread().interrupt();
        throw new IOException("Interrupted writing to BookKeeper", e);
      } catch (BKException e) {
        throw new IOException("Failed to write to BookKeeper", e);
      }
    }
docs: Write the buffer to a new entry in a BookKeeper ledger or throw
  an IOException if we are unable to successfully write to a quorum
  of bookies
  @param buf Buffer to write from
  @param off Offset in the buffer
  @param len How many bytes to write, starting the offset
  @throws IOException If we are interrupted while writing to BookKeeper or
  if we are unable to successfully add the entry to
  a quorum of bookies.