public static void offer(Publication publication,BufferFiller fillBuffer,int length,int timeout,TimeUnit timeUnit){
  if (publication.isClosed()) {
    throw new NotConnectedException();
  }
  final MutableDirectBuffer buffer=getDirectBuffer(length);
  fillBuffer.fill(0,buffer);
  final long start=System.nanoTime();
  do {
    final long current=System.nanoTime();
    if ((current - start) > timeUnit.toNanos(timeout)) {
      throw new TimedOutException();
    }
    final long offer=publication.offer(buffer);
    if (offer >= 0) {
      break;
    }
 else     if (Publication.NOT_CONNECTED == offer) {
      throw new NotConnectedException();
    }
  }
 while (true);
  recycleDirectBuffer(buffer);
}

public static void offer ( Publication publication , BufferFiller fillBuffer , int length , int timeout , TimeUnit timeUnit ) { if ( publication . isClosed ( ) ) { throw new NotConnectedException ( ) ; } final MutableDirectBuffer buffer = getDirectBuffer ( length ) ; fillBuffer . fill ( 0 , buffer ) ; final long start = System . nanoTime ( ) ; do { final long current = System . nanoTime ( ) ; if ( ( current - start ) > timeUnit . toNanos ( timeout ) ) { throw new TimedOutException ( ) ; } final long offer = publication . offer ( buffer ) ; if ( offer >= 0 ) { break ; } else if ( Publication . NOT_CONNECTED == offer ) { throw new NotConnectedException ( ) ; } } while ( true ) ; recycleDirectBuffer ( buffer ) ; }
sends a message using offer . this method will spin - lock if aeron signals back pressure . < p > this method of sending data does need to know how long the message is .
