1616package io .reactivex .netty .protocol .http .sse ;
1717
1818import io .netty .buffer .ByteBuf ;
19- import io .netty .buffer .ByteBufProcessor ;
2019import io .netty .channel .ChannelHandlerContext ;
2120import io .netty .handler .codec .ByteToMessageDecoder ;
21+ import io .netty .util .ByteProcessor ;
2222import org .slf4j .Logger ;
2323import org .slf4j .LoggerFactory ;
2424
@@ -38,36 +38,36 @@ public class ServerSentEventDecoder extends ByteToMessageDecoder {
3838 private static final char [] DATA_FIELD_NAME = "data" .toCharArray ();
3939 private static final char [] ID_FIELD_NAME = "id" .toCharArray ();
4040
41- protected static final ByteBufProcessor SKIP_TILL_LINE_DELIMITER_PROCESSOR = new ByteBufProcessor () {
41+ protected static final ByteProcessor SKIP_TILL_LINE_DELIMITER_PROCESSOR = new ByteProcessor () {
4242 @ Override
4343 public boolean process (byte value ) throws Exception {
4444 return !isLineDelimiter ((char ) value );
4545 }
4646 };
4747
48- protected static final ByteBufProcessor SKIP_LINE_DELIMITERS_AND_SPACES_PROCESSOR = new ByteBufProcessor () {
48+ protected static final ByteProcessor SKIP_LINE_DELIMITERS_AND_SPACES_PROCESSOR = new ByteProcessor () {
4949 @ Override
5050 public boolean process (byte value ) throws Exception {
5151 return isLineDelimiter ((char ) value ) || (char ) value == ' ' ;
5252 }
5353 };
5454
55- protected static final ByteBufProcessor SKIP_COLON_AND_WHITE_SPACE_PROCESSOR = new ByteBufProcessor () {
55+ protected static final ByteProcessor SKIP_COLON_AND_WHITE_SPACE_PROCESSOR = new ByteProcessor () {
5656 @ Override
5757 public boolean process (byte value ) throws Exception {
5858 char valueChar = (char ) value ;
5959 return valueChar == ':' || valueChar == ' ' ;
6060 }
6161 };
6262
63- protected static final ByteBufProcessor SCAN_COLON_PROCESSOR = new ByteBufProcessor () {
63+ protected static final ByteProcessor SCAN_COLON_PROCESSOR = new ByteProcessor () {
6464 @ Override
6565 public boolean process (byte value ) throws Exception {
6666 return (char ) value != ':' ;
6767 }
6868 };
6969
70- protected static final ByteBufProcessor SCAN_EOL_PROCESSOR = new ByteBufProcessor () {
70+ protected static final ByteProcessor SCAN_EOL_PROCESSOR = new ByteProcessor () {
7171 @ Override
7272 public boolean process (byte value ) throws Exception {
7373 return !isLineDelimiter ((char ) value );
@@ -340,7 +340,7 @@ private static boolean skipTillEOL(ByteBuf in) {
340340 return skipTillMatching (in , SKIP_TILL_LINE_DELIMITER_PROCESSOR );
341341 }
342342
343- protected static boolean skipTillMatching (ByteBuf byteBuf , ByteBufProcessor processor ) {
343+ protected static boolean skipTillMatching (ByteBuf byteBuf , ByteProcessor processor ) {
344344 final int lastIndexProcessed = byteBuf .forEachByte (processor );
345345 if (-1 == lastIndexProcessed ) {
346346 byteBuf .readerIndex (byteBuf .readerIndex () + byteBuf .readableBytes ()); // If all the remaining bytes are to be ignored, discard the buffer.
0 commit comments