private void emitDataFrame(boolean outFinished) throws IOException {
  long toWrite;
synchronized (FramedStream.this) {
    writeTimeout.enter();
    try {
      while (bytesLeftInWriteWindow <= 0 && !finished && !closed && errorCode == null) {
        waitForIo();
      }
    }
  finally {
      writeTimeout.exitAndThrowIfTimedOut();
    }
    checkOutNotClosed();
    toWrite=Math.min(bytesLeftInWriteWindow,sendBuffer.size());
    bytesLeftInWriteWindow-=toWrite;
  }
  writeTimeout.enter();
  try {
    connection.writeData(id,outFinished && toWrite == sendBuffer.size(),sendBuffer,toWrite);
  }
  finally {
    writeTimeout.exitAndThrowIfTimedOut();
  }
}

private void emitDataFrame ( boolean outFinished ) throws IOException { long toWrite ; synchronized ( FramedStream . this ) { writeTimeout . enter ( ) ; try { while ( bytesLeftInWriteWindow <= 0 && ! finished && ! closed && errorCode == null ) { waitForIo ( ) ; } } finally { writeTimeout . exitAndThrowIfTimedOut ( ) ; } checkOutNotClosed ( ) ; toWrite = Math . min ( bytesLeftInWriteWindow , sendBuffer . size ( ) ) ; bytesLeftInWriteWindow -= toWrite ; } writeTimeout . enter ( ) ; try { connection . writeData ( id , outFinished && toWrite == sendBuffer . size ( ) , sendBuffer , toWrite ) ; } finally { writeTimeout . exitAndThrowIfTimedOut ( ) ; } }
emit a single data frame to the connection . the frame ' s size be limited by this stream ' s write window . this method will block until the write window is nonempty .
