1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package io.netty.buffer;
18
19 public interface ByteBufProcessor {
20
21
22
23
24 ByteBufProcessor FIND_NUL = new ByteBufProcessor() {
25 @Override
26 public boolean process(byte value) throws Exception {
27 return value != 0;
28 }
29 };
30
31
32
33
34 ByteBufProcessor FIND_NON_NUL = new ByteBufProcessor() {
35 @Override
36 public boolean process(byte value) throws Exception {
37 return value == 0;
38 }
39 };
40
41
42
43
44 ByteBufProcessor FIND_CR = new ByteBufProcessor() {
45 @Override
46 public boolean process(byte value) throws Exception {
47 return value != '\r';
48 }
49 };
50
51
52
53
54 ByteBufProcessor FIND_NON_CR = new ByteBufProcessor() {
55 @Override
56 public boolean process(byte value) throws Exception {
57 return value == '\r';
58 }
59 };
60
61
62
63
64 ByteBufProcessor FIND_LF = new ByteBufProcessor() {
65 @Override
66 public boolean process(byte value) throws Exception {
67 return value != '\n';
68 }
69 };
70
71
72
73
74 ByteBufProcessor FIND_NON_LF = new ByteBufProcessor() {
75 @Override
76 public boolean process(byte value) throws Exception {
77 return value == '\n';
78 }
79 };
80
81
82
83
84 ByteBufProcessor FIND_CRLF = new ByteBufProcessor() {
85 @Override
86 public boolean process(byte value) throws Exception {
87 return value != '\r' && value != '\n';
88 }
89 };
90
91
92
93
94 ByteBufProcessor FIND_NON_CRLF = new ByteBufProcessor() {
95 @Override
96 public boolean process(byte value) throws Exception {
97 return value == '\r' || value == '\n';
98 }
99 };
100
101
102
103
104 ByteBufProcessor FIND_LINEAR_WHITESPACE = new ByteBufProcessor() {
105 @Override
106 public boolean process(byte value) throws Exception {
107 return value != ' ' && value != '\t';
108 }
109 };
110
111
112
113
114 ByteBufProcessor FIND_NON_LINEAR_WHITESPACE = new ByteBufProcessor() {
115 @Override
116 public boolean process(byte value) throws Exception {
117 return value == ' ' || value == '\t';
118 }
119 };
120
121
122
123
124
125 boolean process(byte value) throws Exception;
126 }