public void write(String path,OffsetInfo offsetInfo) throws ZkException {
  try {
    String data=MAPPER.writeValueAsString(offsetInfo);
    LOGGER.debug("Writing to Zookeeper Path {} OffsetInfo {}",path,data);
    writeInternal(path,data.getBytes(Charset.forName(DEFAULT_CHARSET)));
  }
 catch (  Exception ex) {
    LOGGER.error("Error writing to Zookeeper..Path {} Payload {}",path,offsetInfo);
    throw new ZkException("Error writing to Zookeeper..Path: " + path + " OffsetInfo: "+ offsetInfo,ex);
  }
}

public void write ( String path , OffsetInfo offsetInfo ) throws ZkException { try { String data = MAPPER . writeValueAsString ( offsetInfo ) ; LOGGER . debug ( "Writing to Zookeeper Path {} OffsetInfo {}" , path , data ) ; writeInternal ( path , data . getBytes ( Charset . forName ( DEFAULT_CHARSET ) ) ) ; } catch ( Exception ex ) { LOGGER . error ( "Error writing to Zookeeper..Path {} Payload {}" , path , offsetInfo ) ; throw new ZkException ( "Error writing to Zookeeper..Path: " + path + " OffsetInfo: " + offsetInfo , ex ) ; } }
write at zookeeper path .
