Sink newMessageSink ( int formatOpcode , long contentLength ) { if ( activeWriter ) { throw new IllegalStateException ( "Another message writer is active. Did you call close()?" ) ; } activeWriter = true ; // Reset FrameSink state for a new writer. frameSink . formatOpcode = formatOpcode ; frameSink . contentLength = contentLength ; frameSink . isFirstFrame = true ; frameSink . closed = false ; return frameSink ; }
Stream a message payload as a series of frames . This allows control frames to be interleaved between parts of the message .