View Javadoc
1   /*
2    * Copyright 2013 The Netty Project
3    *
4    * The Netty Project licenses this file to you under the Apache License,
5    * version 2.0 (the "License"); you may not use this file except in compliance
6    * with the License. You may obtain a copy of the License at:
7    *
8    *   https://www.apache.org/licenses/LICENSE-2.0
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12   * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13   * License for the specific language governing permissions and limitations
14   * under the License.
15   */
16  
17  package io.netty.buffer;
18  
19  import io.netty.util.ByteProcessor;
20  
21  /**
22   * @deprecated Use {@link ByteProcessor}.
23   */
24  @Deprecated
25  public interface ByteBufProcessor extends ByteProcessor {
26  
27      /**
28       * @deprecated Use {@link ByteProcessor#FIND_NUL}.
29       */
30      @Deprecated
31      ByteBufProcessor FIND_NUL = new ByteBufProcessor() {
32          @Override
33          public boolean process(byte value) throws Exception {
34              return value != 0;
35          }
36      };
37  
38      /**
39       * @deprecated Use {@link ByteProcessor#FIND_NON_NUL}.
40       */
41      @Deprecated
42      ByteBufProcessor FIND_NON_NUL = new ByteBufProcessor() {
43          @Override
44          public boolean process(byte value) throws Exception {
45              return value == 0;
46          }
47      };
48  
49      /**
50       * @deprecated Use {@link ByteProcessor#FIND_CR}.
51       */
52      @Deprecated
53      ByteBufProcessor FIND_CR = new ByteBufProcessor() {
54          @Override
55          public boolean process(byte value) throws Exception {
56              return value != '\r';
57          }
58      };
59  
60      /**
61       * @deprecated Use {@link ByteProcessor#FIND_NON_CR}.
62       */
63      @Deprecated
64      ByteBufProcessor FIND_NON_CR = new ByteBufProcessor() {
65          @Override
66          public boolean process(byte value) throws Exception {
67              return value == '\r';
68          }
69      };
70  
71      /**
72       * @deprecated Use {@link ByteProcessor#FIND_LF}.
73       */
74      @Deprecated
75      ByteBufProcessor FIND_LF = new ByteBufProcessor() {
76          @Override
77          public boolean process(byte value) throws Exception {
78              return value != '\n';
79          }
80      };
81  
82      /**
83       * @deprecated Use {@link ByteProcessor#FIND_NON_LF}.
84       */
85      @Deprecated
86      ByteBufProcessor FIND_NON_LF = new ByteBufProcessor() {
87          @Override
88          public boolean process(byte value) throws Exception {
89              return value == '\n';
90          }
91      };
92  
93      /**
94       * @deprecated Use {@link ByteProcessor#FIND_CRLF}.
95       */
96      @Deprecated
97      ByteBufProcessor FIND_CRLF = new ByteBufProcessor() {
98          @Override
99          public boolean process(byte value) throws Exception {
100             return value != '\r' && value != '\n';
101         }
102     };
103 
104     /**
105      * @deprecated Use {@link ByteProcessor#FIND_NON_CRLF}.
106      */
107     @Deprecated
108     ByteBufProcessor FIND_NON_CRLF = new ByteBufProcessor() {
109         @Override
110         public boolean process(byte value) throws Exception {
111             return value == '\r' || value == '\n';
112         }
113     };
114 
115     /**
116      * @deprecated Use {@link ByteProcessor#FIND_LINEAR_WHITESPACE}.
117      */
118     @Deprecated
119     ByteBufProcessor FIND_LINEAR_WHITESPACE = new ByteBufProcessor() {
120         @Override
121         public boolean process(byte value) throws Exception {
122             return value != ' ' && value != '\t';
123         }
124     };
125 
126     /**
127      * @deprecated Use {@link ByteProcessor#FIND_NON_LINEAR_WHITESPACE}.
128      */
129     @Deprecated
130     ByteBufProcessor FIND_NON_LINEAR_WHITESPACE = new ByteBufProcessor() {
131         @Override
132         public boolean process(byte value) throws Exception {
133             return value == ' ' || value == '\t';
134         }
135     };
136 }