code: public static <B extends Buffer> Output<B> fromSink(
              ManagedBuffer<B> buffer, boolean endOfRecord) {
          return new Output<>(buffer, true, endOfRecord);
      }
docs: Create a new event with the given buffer. Creating the event
  flips the buffer, which is assumed to have been used for
  collecting data up to now.
  
  @param buffer the buffer with the data
  @param endOfRecord if the event ends a data record