forked from netty/netty
-
Notifications
You must be signed in to change notification settings - Fork 0
/
AbstractWrappedByteBuf.java
264 lines (213 loc) · 7.35 KB
/
AbstractWrappedByteBuf.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
/*
* Copyright 2012 The Netty Project
*
* The Netty Project licenses this file to you under the Apache License,
* version 2.0 (the "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at:
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*/
package io.netty.buffer;
import java.io.IOException;
import java.io.OutputStream;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import java.nio.ReadOnlyBufferException;
/**
* Abstract base class for WrappedByteBuf implementations.
*/
public abstract class AbstractWrappedByteBuf extends AbstractByteBuf implements WrappedByteBuf {
protected AbstractWrappedByteBuf(ByteOrder endianness, int maxCapacity) {
super(endianness, maxCapacity);
}
@Override
public WrappedByteBuf capacity(int newCapacity) {
throw new UnsupportedOperationException();
}
@Override
public WrappedByteBuf discardReadBytes() {
return (WrappedByteBuf) super.discardReadBytes();
}
@Override
public WrappedByteBuf readerIndex(int readerIndex) {
return (WrappedByteBuf) super.readerIndex(readerIndex);
}
@Override
public WrappedByteBuf writerIndex(int writerIndex) {
return (WrappedByteBuf) super.writerIndex(writerIndex);
}
@Override
public WrappedByteBuf setIndex(int readerIndex, int writerIndex) {
return (WrappedByteBuf) super.setIndex(readerIndex, writerIndex);
}
@Override
public WrappedByteBuf clear() {
return (WrappedByteBuf) super.clear();
}
@Override
public WrappedByteBuf markReaderIndex() {
return (WrappedByteBuf) super.markReaderIndex();
}
@Override
public WrappedByteBuf resetReaderIndex() {
return (WrappedByteBuf) super.resetReaderIndex();
}
@Override
public WrappedByteBuf markWriterIndex() {
return (WrappedByteBuf) super.markWriterIndex();
}
@Override
public WrappedByteBuf resetWriterIndex() {
return (WrappedByteBuf) super.resetWriterIndex();
}
@Override
public WrappedByteBuf ensureWritableBytes(int minWritableBytes) {
return (WrappedByteBuf) super.ensureWritableBytes(minWritableBytes);
}
@Override
public WrappedByteBuf getBytes(int index, ByteBuf dst) {
return (WrappedByteBuf) super.getBytes(index, dst);
}
@Override
public WrappedByteBuf getBytes(int index, ByteBuf dst, int length) {
return (WrappedByteBuf) super.getBytes(index, dst, length);
}
@Override
public WrappedByteBuf getBytes(int index, byte[] dst) {
return (WrappedByteBuf) super.getBytes(index, dst);
}
@Override
public WrappedByteBuf setBoolean(int index, boolean value) {
return (WrappedByteBuf) super.setBoolean(index, value);
}
@Override
public WrappedByteBuf setChar(int index, int value) {
return (WrappedByteBuf) super.setChar(index, value);
}
@Override
public WrappedByteBuf setFloat(int index, float value) {
return (WrappedByteBuf) super.setFloat(index, value);
}
@Override
public WrappedByteBuf setDouble(int index, double value) {
return (WrappedByteBuf) super.setDouble(index, value);
}
@Override
public WrappedByteBuf setBytes(int index, ByteBuf src) {
return (WrappedByteBuf) super.setBytes(index, src);
}
@Override
public WrappedByteBuf setBytes(int index, ByteBuf src, int length) {
return (WrappedByteBuf) super.setBytes(index, src, length);
}
@Override
public WrappedByteBuf setBytes(int index, byte[] src) {
return (WrappedByteBuf) super.setBytes(index, src);
}
@Override
public WrappedByteBuf setZero(int index, int length) {
return (WrappedByteBuf) super.setZero(index, length);
}
@Override
public WrappedByteBuf readBytes(ByteBuf dst) {
return (WrappedByteBuf) super.readBytes(dst);
}
@Override
public WrappedByteBuf readBytes(ByteBuf dst, int length) {
return (WrappedByteBuf) super.readBytes(dst, length);
}
@Override
public WrappedByteBuf readBytes(ByteBuf dst, int dstIndex, int length) {
return (WrappedByteBuf) super.readBytes(dst, dstIndex, length);
}
@Override
public WrappedByteBuf readBytes(byte[] dst) {
return (WrappedByteBuf) super.readBytes(dst);
}
@Override
public WrappedByteBuf readBytes(byte[] dst, int dstIndex, int length) {
return (WrappedByteBuf) super.readBytes(dst, dstIndex, length);
}
@Override
public WrappedByteBuf readBytes(ByteBuffer dst) {
return (WrappedByteBuf) super.readBytes(dst);
}
@Override
public WrappedByteBuf readBytes(OutputStream out, int length) throws IOException {
return (WrappedByteBuf) super.readBytes(out, length);
}
@Override
public WrappedByteBuf skipBytes(int length) {
return (WrappedByteBuf) super.skipBytes(length);
}
@Override
public WrappedByteBuf writeBoolean(boolean value) {
return (WrappedByteBuf) super.writeBoolean(value);
}
@Override
public WrappedByteBuf writeByte(int value) {
return (WrappedByteBuf) super.writeByte(value);
}
@Override
public WrappedByteBuf writeShort(int value) {
return (WrappedByteBuf) super.writeShort(value);
}
@Override
public WrappedByteBuf writeMedium(int value) {
return (WrappedByteBuf) super.writeMedium(value);
}
@Override
public WrappedByteBuf writeInt(int value) {
return (WrappedByteBuf) super.writeInt(value);
}
@Override
public WrappedByteBuf writeLong(long value) {
return (WrappedByteBuf) super.writeLong(value);
}
@Override
public WrappedByteBuf writeChar(int value) {
return (WrappedByteBuf) super.writeChar(value);
}
@Override
public WrappedByteBuf writeFloat(float value) {
return (WrappedByteBuf) super.writeFloat(value);
}
@Override
public WrappedByteBuf writeDouble(double value) {
return (WrappedByteBuf) super.writeDouble(value);
}
@Override
public WrappedByteBuf writeBytes(ByteBuf src) {
return (WrappedByteBuf) super.writeBytes(src);
}
@Override
public WrappedByteBuf writeBytes(ByteBuf src, int length) {
return (WrappedByteBuf) super.writeBytes(src, length);
}
@Override
public WrappedByteBuf writeBytes(ByteBuf src, int srcIndex, int length) {
return (WrappedByteBuf) super.writeBytes(src, srcIndex, length);
}
@Override
public WrappedByteBuf writeBytes(byte[] src) {
return (WrappedByteBuf) super.writeBytes(src);
}
@Override
public WrappedByteBuf writeBytes(byte[] src, int srcIndex, int length) {
return (WrappedByteBuf) super.writeBytes(src, srcIndex, length);
}
@Override
public WrappedByteBuf writeBytes(ByteBuffer src) {
return (WrappedByteBuf) super.writeBytes(src);
}
@Override
public WrappedByteBuf writeZero(int length) {
return (WrappedByteBuf) super.writeZero(length);
}
}