Mercurial Hosting > luan
comparison src/org/eclipse/jetty/io/View.java @ 1029:4e5e9e3c25b3
remove Buffer.equalsIgnoreCase()
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Thu, 03 Nov 2016 00:55:20 -0600 |
parents | cf0367978d8b |
children | 80cad9086593 |
comparison
equal
deleted
inserted
replaced
1028:2ea54e6117c3 | 1029:4e5e9e3c25b3 |
---|---|
64 /** | 64 /** |
65 * Update view to buffer | 65 * Update view to buffer |
66 */ | 66 */ |
67 public void update(Buffer buffer) | 67 public void update(Buffer buffer) |
68 { | 68 { |
69 _access=READWRITE; | 69 _access = READWRITE; |
70 _buffer=buffer.buffer(); | 70 _buffer = buffer.buffer(); |
71 setGetIndex(0); | 71 setGetIndex(0); |
72 setPutIndex(buffer.putIndex()); | 72 setPutIndex(buffer.putIndex()); |
73 setGetIndex(buffer.getIndex()); | 73 setGetIndex(buffer.getIndex()); |
74 setMarkIndex(buffer.markIndex()); | 74 setMarkIndex(buffer.markIndex()); |
75 _access=buffer.isReadOnly()?READONLY:READWRITE; | 75 _access = buffer.isReadOnly()?READONLY:READWRITE; |
76 } | 76 } |
77 | 77 |
78 public void update(int get, int put) | 78 @Override |
79 { | |
80 int a=_access; | |
81 _access=READWRITE; | |
82 setGetIndex(0); | |
83 setPutIndex(put); | |
84 setGetIndex(get); | |
85 setMarkIndex(-1); | |
86 _access=a; | |
87 } | |
88 | |
89 /** | |
90 * @return The {@link Buffer#array()} from the underlying buffer. | |
91 */ | |
92 public byte[] array() | 79 public byte[] array() |
93 { | 80 { |
94 return _buffer.array(); | 81 return _buffer.array(); |
95 } | 82 } |
96 | 83 |
97 /** | |
98 * @return The {@link Buffer#buffer()} from the underlying buffer. | |
99 */ | |
100 @Override | 84 @Override |
101 public Buffer buffer() | 85 public Buffer buffer() |
102 { | 86 { |
103 return _buffer.buffer(); | 87 return _buffer.buffer(); |
104 } | 88 } |
105 | 89 |
106 /** | 90 @Override |
107 * @return The {@link Buffer#capacity} of the underlying buffer. | |
108 */ | |
109 public int capacity() | 91 public int capacity() |
110 { | 92 { |
111 return _buffer.capacity(); | 93 return _buffer.capacity(); |
112 } | 94 } |
113 | 95 |
114 /** | |
115 * | |
116 */ | |
117 @Override | 96 @Override |
118 public void clear() | 97 public void clear() |
119 { | 98 { |
120 setMarkIndex(-1); | 99 setMarkIndex(-1); |
121 setGetIndex(0); | 100 setGetIndex(0); |
122 setPutIndex(_buffer.getIndex()); | 101 setPutIndex(_buffer.getIndex()); |
123 setGetIndex(_buffer.getIndex()); | 102 setGetIndex(_buffer.getIndex()); |
124 } | 103 } |
125 | 104 |
126 /** | |
127 * | |
128 */ | |
129 @Override | 105 @Override |
130 public void compact() | 106 public void compact() |
131 { | 107 { |
132 // TODO | 108 // TODO |
133 } | 109 } |
141 public boolean equals(Object obj) | 117 public boolean equals(Object obj) |
142 { | 118 { |
143 return this==obj ||((obj instanceof Buffer)&& obj.equals(this)) || super.equals(obj); | 119 return this==obj ||((obj instanceof Buffer)&& obj.equals(this)) || super.equals(obj); |
144 } | 120 } |
145 | 121 |
146 /** | |
147 * @return Whether the underlying buffer is {@link Buffer#isReadOnly read only} | |
148 */ | |
149 @Override | 122 @Override |
150 public boolean isReadOnly() | 123 public boolean isReadOnly() |
151 { | 124 { |
152 return _buffer.isReadOnly(); | 125 return _buffer.isReadOnly(); |
153 } | 126 } |
154 | 127 |
155 /** | |
156 * @return Whether the underlying buffer is {@link Buffer#isVolatile volatile} | |
157 */ | |
158 @Override | 128 @Override |
159 public boolean isVolatile() | 129 public boolean isVolatile() |
160 { | 130 { |
161 return true; | 131 return true; |
162 } | 132 } |
163 | 133 |
164 /** | 134 @Override |
165 * @return The result of calling {@link Buffer#peek(int)} on the underlying buffer | |
166 */ | |
167 public byte peek(int index) | 135 public byte peek(int index) |
168 { | 136 { |
169 return _buffer.peek(index); | 137 return _buffer.peek(index); |
170 } | 138 } |
171 | 139 |
172 /** | 140 @Override |
173 * @return The result of calling {@link Buffer#peek(int, byte[], int, int)} on the underlying buffer | |
174 */ | |
175 public int peek(int index, byte[] b, int offset, int length) | 141 public int peek(int index, byte[] b, int offset, int length) |
176 { | 142 { |
177 return _buffer.peek(index,b,offset,length); | 143 return _buffer.peek(index,b,offset,length); |
178 } | 144 } |
179 | 145 |
180 /** | |
181 * @return The result of calling {@link Buffer#peek(int, int)} on the underlying buffer | |
182 */ | |
183 @Override | 146 @Override |
184 public Buffer peek(int index, int length) | 147 public Buffer peek(int index, int length) |
185 { | 148 { |
186 return _buffer.peek(index, length); | 149 return _buffer.peek(index, length); |
187 } | 150 } |
188 | 151 |
189 /** | |
190 * @param index | |
191 * @param src | |
192 */ | |
193 @Override | 152 @Override |
194 public int poke(int index, Buffer src) | 153 public int poke(int index, Buffer src) |
195 { | 154 { |
196 return _buffer.poke(index,src); | 155 return _buffer.poke(index,src); |
197 } | 156 } |
198 | 157 |
199 /** | 158 @Override |
200 * @param index | |
201 * @param b | |
202 */ | |
203 public void poke(int index, byte b) | 159 public void poke(int index, byte b) |
204 { | 160 { |
205 _buffer.poke(index,b); | 161 _buffer.poke(index,b); |
206 } | 162 } |
207 | 163 |
208 /** | |
209 * @param index | |
210 * @param b | |
211 * @param offset | |
212 * @param length | |
213 */ | |
214 @Override | 164 @Override |
215 public int poke(int index, byte[] b, int offset, int length) | 165 public int poke(int index, byte[] b, int offset, int length) |
216 { | 166 { |
217 return _buffer.poke(index,b,offset,length); | 167 return _buffer.poke(index,b,offset,length); |
218 } | 168 } |