code: @Override
      public DecodingState decode(IoBuffer in, ProtocolDecoderOutput out)
              throws Exception {
          while (in.hasRemaining()) {
              byte b = in.get();
              
              if (b == LF) {
              	// CRLF or LF
              	SseEolStyle eolStyle = hasCR ? SseEolStyle.CRLF : SseEolStyle.LF;
                  hasCR = false;
                  return finishDecode(eolStyle, out);
              }
              else if (hasCR) {
              	// CR followed by !LF
                  hasCR = false;
                  in.skip(-1);
                  return finishDecode(SseEolStyle.CR, out);
              }
              else if (b == CR) {
              	// potential CR or CRLF
              	hasCR = true;
              }
              else {
                  in.skip(-1);
                  return finishDecode(SseEolStyle.NONE, out);
              }
          }
  
          return this;
      }
docs: {@inheritDoc}