View Javadoc
1   /*
2    *  Licensed to the Apache Software Foundation (ASF) under one
3    *  or more contributor license agreements.  See the NOTICE file
4    *  distributed with this work for additional information
5    *  regarding copyright ownership.  The ASF licenses this file
6    *  to you under the Apache License, Version 2.0 (the
7    *  "License"); you may not use this file except in compliance
8    *  with the License.  You may obtain a copy of the License at
9    *
10   *    http://www.apache.org/licenses/LICENSE-2.0
11   *
12   *  Unless required by applicable law or agreed to in writing,
13   *  software distributed under the License is distributed on an
14   *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15   *  KIND, either express or implied.  See the License for the
16   *  specific language governing permissions and limitations
17   *  under the License.
18   *
19   */
20  package org.apache.mina.core.buffer;
21  
22  import java.io.FileOutputStream;
23  import java.io.InputStream;
24  import java.io.OutputStream;
25  import java.nio.ByteBuffer;
26  import java.nio.ByteOrder;
27  import java.nio.CharBuffer;
28  import java.nio.DoubleBuffer;
29  import java.nio.FloatBuffer;
30  import java.nio.IntBuffer;
31  import java.nio.LongBuffer;
32  import java.nio.ShortBuffer;
33  import java.nio.charset.CharacterCodingException;
34  import java.nio.charset.CharsetDecoder;
35  import java.nio.charset.CharsetEncoder;
36  import java.util.Set;
37  
38  /**
39   * A {@link IoBuffer} that wraps a buffer and proxies any operations to it.
40   * <p>
41   * You can think this class like a {@link FileOutputStream}.  All operations
42   * are proxied by default so that you can extend this class and override existing
43   * operations selectively.  You can introduce new operations, too.
44   *
45   * @author <a href="http://mina.apache.org">Apache MINA Project</a>
46   */
47  public class IoBufferWrapper extends IoBuffer {
48  
49      /**
50       * The buffer proxied by this proxy.
51       */
52      private final IoBuffer buf;
53  
54      /**
55       * Create a new instance.
56       * @param buf the buffer to be proxied
57       */
58      protected IoBufferWrapper(IoBuffer buf) {
59          if (buf == null) {
60              throw new IllegalArgumentException("buf");
61          }
62          this.buf = buf;
63      }
64  
65      /**
66       * @return the parent buffer that this buffer wrapped.
67       */
68      public IoBuffer getParentBuffer() {
69          return buf;
70      }
71  
72      /**
73       * {@inheritDoc}
74       */
75      @Override
76      public boolean isDirect() {
77          return buf.isDirect();
78      }
79  
80      /**
81       * {@inheritDoc}
82       */
83      @Override
84      public ByteBuffer buf() {
85          return buf.buf();
86      }
87  
88      /**
89       * {@inheritDoc}
90       */
91      @Override
92      public int capacity() {
93          return buf.capacity();
94      }
95  
96      /**
97       * {@inheritDoc}
98       */
99      @Override
100     public int position() {
101         return buf.position();
102     }
103 
104     /**
105      * {@inheritDoc}
106      */
107     @Override
108     public IoBuffer position(int newPosition) {
109         buf.position(newPosition);
110         return this;
111     }
112 
113     /**
114      * {@inheritDoc}
115      */
116     @Override
117     public int limit() {
118         return buf.limit();
119     }
120 
121     /**
122      * {@inheritDoc}
123      */
124     @Override
125     public IoBuffer limit(int newLimit) {
126         buf.limit(newLimit);
127         return this;
128     }
129 
130     /**
131      * {@inheritDoc}
132      */
133     @Override
134     public IoBuffer mark() {
135         buf.mark();
136         return this;
137     }
138 
139     /**
140      * {@inheritDoc}
141      */
142     @Override
143     public IoBuffer reset() {
144         buf.reset();
145         return this;
146     }
147 
148     /**
149      * {@inheritDoc}
150      */
151     @Override
152     public IoBuffer clear() {
153         buf.clear();
154         return this;
155     }
156 
157     /**
158      * {@inheritDoc}
159      */
160     @Override
161     public IoBuffer sweep() {
162         buf.sweep();
163         return this;
164     }
165 
166     /**
167      * {@inheritDoc}
168      */
169     @Override
170     public IoBuffer sweep(byte value) {
171         buf.sweep(value);
172         return this;
173     }
174 
175     /**
176      * {@inheritDoc}
177      */
178     @Override
179     public IoBuffer flip() {
180         buf.flip();
181         return this;
182     }
183 
184     /**
185      * {@inheritDoc}
186      */
187     @Override
188     public IoBuffer rewind() {
189         buf.rewind();
190         return this;
191     }
192 
193     /**
194      * {@inheritDoc}
195      */
196     @Override
197     public int remaining() {
198         return buf.remaining();
199     }
200 
201     /**
202      * {@inheritDoc}
203      */
204     @Override
205     public boolean hasRemaining() {
206         return buf.hasRemaining();
207     }
208 
209     /**
210      * {@inheritDoc}
211      */
212     @Override
213     public byte get() {
214         return buf.get();
215     }
216 
217     /**
218      * {@inheritDoc}
219      */
220     @Override
221     public short getUnsigned() {
222         return buf.getUnsigned();
223     }
224 
225     /**
226      * {@inheritDoc}
227      */
228     @Override
229     public IoBuffer put(byte b) {
230         buf.put(b);
231         return this;
232     }
233 
234     /**
235      * {@inheritDoc}
236      */
237     @Override
238     public byte get(int index) {
239         return buf.get(index);
240     }
241 
242     /**
243      * {@inheritDoc}
244      */
245     @Override
246     public short getUnsigned(int index) {
247         return buf.getUnsigned(index);
248     }
249 
250     /**
251      * {@inheritDoc}
252      */
253     @Override
254     public IoBuffer put(int index, byte b) {
255         buf.put(index, b);
256         return this;
257     }
258 
259     /**
260      * {@inheritDoc}
261      */
262     @Override
263     public IoBuffer get(byte[] dst, int offset, int length) {
264         buf.get(dst, offset, length);
265         return this;
266     }
267 
268     /**
269      * {@inheritDoc}
270      */
271     @Override
272     public IoBuffer getSlice(int index, int length) {
273         return buf.getSlice(index, length);
274     }
275 
276     /**
277      * {@inheritDoc}
278      */
279     @Override
280     public IoBuffer getSlice(int length) {
281         return buf.getSlice(length);
282     }
283 
284     /**
285      * {@inheritDoc}
286      */
287     @Override
288     public IoBuffer get(byte[] dst) {
289         buf.get(dst);
290         return this;
291     }
292 
293     /**
294      * {@inheritDoc}
295      */
296     @Override
297     public IoBuffer put(IoBuffer src) {
298         buf.put(src);
299         return this;
300     }
301 
302     /**
303      * {@inheritDoc}
304      */
305     @Override
306     public IoBuffer put(ByteBuffer src) {
307         buf.put(src);
308         return this;
309     }
310 
311     /**
312      * {@inheritDoc}
313      */
314     @Override
315     public IoBuffer put(byte[] src, int offset, int length) {
316         buf.put(src, offset, length);
317         return this;
318     }
319 
320     /**
321      * {@inheritDoc}
322      */
323     @Override
324     public IoBuffer put(byte[] src) {
325         buf.put(src);
326         return this;
327     }
328 
329     /**
330      * {@inheritDoc}
331      */
332     @Override
333     public IoBuffer compact() {
334         buf.compact();
335         return this;
336     }
337 
338     /**
339      * {@inheritDoc}
340      */
341     @Override
342     public String toString() {
343         return buf.toString();
344     }
345 
346     /**
347      * {@inheritDoc}
348      */
349     @Override
350     public int hashCode() {
351         return buf.hashCode();
352     }
353 
354     /**
355      * {@inheritDoc}
356      */
357     @Override
358     public boolean equals(Object ob) {
359         return buf.equals(ob);
360     }
361 
362     /**
363      * {@inheritDoc}
364      */
365     @Override
366     public int compareTo(IoBuffer that) {
367         return buf.compareTo(that);
368     }
369 
370     /**
371      * {@inheritDoc}
372      */
373     @Override
374     public ByteOrder order() {
375         return buf.order();
376     }
377 
378     /**
379      * {@inheritDoc}
380      */
381     @Override
382     public IoBuffer order(ByteOrder bo) {
383         buf.order(bo);
384         return this;
385     }
386 
387     /**
388      * {@inheritDoc}
389      */
390     @Override
391     public char getChar() {
392         return buf.getChar();
393     }
394 
395     /**
396      * {@inheritDoc}
397      */
398     @Override
399     public IoBuffer putChar(char value) {
400         buf.putChar(value);
401         return this;
402     }
403 
404     /**
405      * {@inheritDoc}
406      */
407     @Override
408     public char getChar(int index) {
409         return buf.getChar(index);
410     }
411 
412     /**
413      * {@inheritDoc}
414      */
415     @Override
416     public IoBuffer putChar(int index, char value) {
417         buf.putChar(index, value);
418         return this;
419     }
420 
421     /**
422      * {@inheritDoc}
423      */
424     @Override
425     public CharBuffer asCharBuffer() {
426         return buf.asCharBuffer();
427     }
428 
429     /**
430      * {@inheritDoc}
431      */
432     @Override
433     public short getShort() {
434         return buf.getShort();
435     }
436 
437     /**
438      * {@inheritDoc}
439      */
440     @Override
441     public int getUnsignedShort() {
442         return buf.getUnsignedShort();
443     }
444 
445     /**
446      * {@inheritDoc}
447      */
448     @Override
449     public IoBuffer putShort(short value) {
450         buf.putShort(value);
451         return this;
452     }
453 
454     /**
455      * {@inheritDoc}
456      */
457     @Override
458     public short getShort(int index) {
459         return buf.getShort(index);
460     }
461 
462     /**
463      * {@inheritDoc}
464      */
465     @Override
466     public int getUnsignedShort(int index) {
467         return buf.getUnsignedShort(index);
468     }
469 
470     /**
471      * {@inheritDoc}
472      */
473     @Override
474     public IoBuffer putShort(int index, short value) {
475         buf.putShort(index, value);
476         return this;
477     }
478 
479     /**
480      * {@inheritDoc}
481      */
482     @Override
483     public ShortBuffer asShortBuffer() {
484         return buf.asShortBuffer();
485     }
486 
487     /**
488      * {@inheritDoc}
489      */
490     @Override
491     public int getInt() {
492         return buf.getInt();
493     }
494 
495     /**
496      * {@inheritDoc}
497      */
498     @Override
499     public long getUnsignedInt() {
500         return buf.getUnsignedInt();
501     }
502 
503     /**
504      * {@inheritDoc}
505      */
506     @Override
507     public IoBuffer putInt(int value) {
508         buf.putInt(value);
509         return this;
510     }
511 
512     /**
513      * {@inheritDoc}
514      */
515     @Override
516     public IoBuffer putUnsignedInt(byte value) {
517         buf.putUnsignedInt(value);
518         return this;
519     }
520 
521     /**
522      * {@inheritDoc}
523      */
524     @Override
525     public IoBuffer putUnsignedInt(int index, byte value) {
526         buf.putUnsignedInt(index, value);
527         return this;
528     }
529 
530     /**
531      * {@inheritDoc}
532      */
533     @Override
534     public IoBuffer putUnsignedInt(short value) {
535         buf.putUnsignedInt(value);
536         return this;
537     }
538 
539     /**
540      * {@inheritDoc}
541      */
542     @Override
543     public IoBuffer putUnsignedInt(int index, short value) {
544         buf.putUnsignedInt(index, value);
545         return this;
546     }
547 
548     /**
549      * {@inheritDoc}
550      */
551     @Override
552     public IoBuffer putUnsignedInt(int value) {
553         buf.putUnsignedInt(value);
554         return this;
555     }
556 
557     /**
558      * {@inheritDoc}
559      */
560     @Override
561     public IoBuffer putUnsignedInt(int index, int value) {
562         buf.putUnsignedInt(index, value);
563         return this;
564     }
565 
566     /**
567      * {@inheritDoc}
568      */
569     @Override
570     public IoBuffer putUnsignedInt(long value) {
571         buf.putUnsignedInt(value);
572         return this;
573     }
574 
575     /**
576      * {@inheritDoc}
577      */
578     @Override
579     public IoBuffer putUnsignedInt(int index, long value) {
580         buf.putUnsignedInt(index, value);
581         return this;
582     }
583 
584     /**
585      * {@inheritDoc}
586      */
587     @Override
588     public IoBuffer putUnsignedShort(byte value) {
589         buf.putUnsignedShort(value);
590         return this;
591     }
592 
593     /**
594      * {@inheritDoc}
595      */
596     @Override
597     public IoBuffer putUnsignedShort(int index, byte value) {
598         buf.putUnsignedShort(index, value);
599         return this;
600     }
601 
602     /**
603      * {@inheritDoc}
604      */
605     @Override
606     public IoBuffer putUnsignedShort(short value) {
607         buf.putUnsignedShort(value);
608         return this;
609     }
610 
611     /**
612      * {@inheritDoc}
613      */
614     @Override
615     public IoBuffer putUnsignedShort(int index, short value) {
616         buf.putUnsignedShort(index, value);
617         return this;
618     }
619 
620     /**
621      * {@inheritDoc}
622      */
623     @Override
624     public IoBuffer putUnsignedShort(int value) {
625         buf.putUnsignedShort(value);
626         return this;
627     }
628 
629     /**
630      * {@inheritDoc}
631      */
632     @Override
633     public IoBuffer putUnsignedShort(int index, int value) {
634         buf.putUnsignedShort(index, value);
635         return this;
636     }
637 
638     /**
639      * {@inheritDoc}
640      */
641     @Override
642     public IoBuffer putUnsignedShort(long value) {
643         buf.putUnsignedShort(value);
644         return this;
645     }
646 
647     /**
648      * {@inheritDoc}
649      */
650     @Override
651     public IoBuffer putUnsignedShort(int index, long value) {
652         buf.putUnsignedShort(index, value);
653         return this;
654     }
655 
656     /**
657      * {@inheritDoc}
658      */
659     @Override
660     public int getInt(int index) {
661         return buf.getInt(index);
662     }
663 
664     /**
665      * {@inheritDoc}
666      */
667     @Override
668     public long getUnsignedInt(int index) {
669         return buf.getUnsignedInt(index);
670     }
671 
672     /**
673      * {@inheritDoc}
674      */
675     @Override
676     public IoBuffer putInt(int index, int value) {
677         buf.putInt(index, value);
678         return this;
679     }
680 
681     /**
682      * {@inheritDoc}
683      */
684     @Override
685     public IntBuffer asIntBuffer() {
686         return buf.asIntBuffer();
687     }
688 
689     /**
690      * {@inheritDoc}
691      */
692     @Override
693     public long getLong() {
694         return buf.getLong();
695     }
696 
697     /**
698      * {@inheritDoc}
699      */
700     @Override
701     public IoBuffer putLong(long value) {
702         buf.putLong(value);
703         return this;
704     }
705 
706     /**
707      * {@inheritDoc}
708      */
709     @Override
710     public long getLong(int index) {
711         return buf.getLong(index);
712     }
713 
714     /**
715      * {@inheritDoc}
716      */
717     @Override
718     public IoBuffer putLong(int index, long value) {
719         buf.putLong(index, value);
720         return this;
721     }
722 
723     /**
724      * {@inheritDoc}
725      */
726     @Override
727     public LongBuffer asLongBuffer() {
728         return buf.asLongBuffer();
729     }
730 
731     /**
732      * {@inheritDoc}
733      */
734     @Override
735     public float getFloat() {
736         return buf.getFloat();
737     }
738 
739     /**
740      * {@inheritDoc}
741      */
742     @Override
743     public IoBuffer putFloat(float value) {
744         buf.putFloat(value);
745         return this;
746     }
747 
748     /**
749      * {@inheritDoc}
750      */
751     @Override
752     public float getFloat(int index) {
753         return buf.getFloat(index);
754     }
755 
756     /**
757      * {@inheritDoc}
758      */
759     @Override
760     public IoBuffer putFloat(int index, float value) {
761         buf.putFloat(index, value);
762         return this;
763     }
764 
765     /**
766      * {@inheritDoc}
767      */
768     @Override
769     public FloatBuffer asFloatBuffer() {
770         return buf.asFloatBuffer();
771     }
772 
773     /**
774      * {@inheritDoc}
775      */
776     @Override
777     public double getDouble() {
778         return buf.getDouble();
779     }
780 
781     /**
782      * {@inheritDoc}
783      */
784     @Override
785     public IoBuffer putDouble(double value) {
786         buf.putDouble(value);
787         return this;
788     }
789 
790     /**
791      * {@inheritDoc}
792      */
793     @Override
794     public double getDouble(int index) {
795         return buf.getDouble(index);
796     }
797 
798     /**
799      * {@inheritDoc}
800      */
801     @Override
802     public IoBuffer putDouble(int index, double value) {
803         buf.putDouble(index, value);
804         return this;
805     }
806 
807     /**
808      * {@inheritDoc}
809      */
810     @Override
811     public DoubleBuffer asDoubleBuffer() {
812         return buf.asDoubleBuffer();
813     }
814 
815     /**
816      * {@inheritDoc}
817      */
818     @Override
819     public String getHexDump() {
820         return buf.getHexDump();
821     }
822 
823     /**
824      * {@inheritDoc}
825      */
826     @Override
827     public String getString(int fieldSize, CharsetDecoder decoder) throws CharacterCodingException {
828         return buf.getString(fieldSize, decoder);
829     }
830 
831     /**
832      * {@inheritDoc}
833      */
834     @Override
835     public String getString(CharsetDecoder decoder) throws CharacterCodingException {
836         return buf.getString(decoder);
837     }
838 
839     /**
840      * {@inheritDoc}
841      */
842     @Override
843     public String getPrefixedString(CharsetDecoder decoder) throws CharacterCodingException {
844         return buf.getPrefixedString(decoder);
845     }
846 
847     /**
848      * {@inheritDoc}
849      */
850     @Override
851     public String getPrefixedString(int prefixLength, CharsetDecoder decoder) throws CharacterCodingException {
852         return buf.getPrefixedString(prefixLength, decoder);
853     }
854 
855     /**
856      * {@inheritDoc}
857      */
858     @Override
859     public IoBuffer putString(CharSequence in, int fieldSize, CharsetEncoder encoder) throws CharacterCodingException {
860         buf.putString(in, fieldSize, encoder);
861         return this;
862     }
863 
864     /**
865      * {@inheritDoc}
866      */
867     @Override
868     public IoBuffer putString(CharSequence in, CharsetEncoder encoder) throws CharacterCodingException {
869         buf.putString(in, encoder);
870         return this;
871     }
872 
873     /**
874      * {@inheritDoc}
875      */
876     @Override
877     public IoBuffer putPrefixedString(CharSequence in, CharsetEncoder encoder) throws CharacterCodingException {
878         buf.putPrefixedString(in, encoder);
879         return this;
880     }
881 
882     /**
883      * {@inheritDoc}
884      */
885     @Override
886     public IoBuffer putPrefixedString(CharSequence in, int prefixLength, CharsetEncoder encoder)
887             throws CharacterCodingException {
888         buf.putPrefixedString(in, prefixLength, encoder);
889         return this;
890     }
891 
892     /**
893      * {@inheritDoc}
894      */
895     @Override
896     public IoBuffer putPrefixedString(CharSequence in, int prefixLength, int padding, CharsetEncoder encoder)
897             throws CharacterCodingException {
898         buf.putPrefixedString(in, prefixLength, padding, encoder);
899         return this;
900     }
901 
902     /**
903      * {@inheritDoc}
904      */
905     @Override
906     public IoBuffer putPrefixedString(CharSequence in, int prefixLength, int padding, byte padValue,
907             CharsetEncoder encoder) throws CharacterCodingException {
908         buf.putPrefixedString(in, prefixLength, padding, padValue, encoder);
909         return this;
910     }
911 
912     /**
913      * {@inheritDoc}
914      */
915     @Override
916     public IoBuffer skip(int size) {
917         buf.skip(size);
918         return this;
919     }
920 
921     /**
922      * {@inheritDoc}
923      */
924     @Override
925     public IoBuffer fill(byte value, int size) {
926         buf.fill(value, size);
927         return this;
928     }
929 
930     /**
931      * {@inheritDoc}
932      */
933     @Override
934     public IoBuffer fillAndReset(byte value, int size) {
935         buf.fillAndReset(value, size);
936         return this;
937     }
938 
939     /**
940      * {@inheritDoc}
941      */
942     @Override
943     public IoBuffer fill(int size) {
944         buf.fill(size);
945         return this;
946     }
947 
948     /**
949      * {@inheritDoc}
950      */
951     @Override
952     public IoBuffer fillAndReset(int size) {
953         buf.fillAndReset(size);
954         return this;
955     }
956 
957     /**
958      * {@inheritDoc}
959      */
960     @Override
961     public boolean isAutoExpand() {
962         return buf.isAutoExpand();
963     }
964 
965     /**
966      * {@inheritDoc}
967      */
968     @Override
969     public IoBuffer setAutoExpand(boolean autoExpand) {
970         buf.setAutoExpand(autoExpand);
971         return this;
972     }
973 
974     /**
975      * {@inheritDoc}
976      */
977     @Override
978     public IoBuffer expand(int pos, int expectedRemaining) {
979         buf.expand(pos, expectedRemaining);
980         return this;
981     }
982 
983     /**
984      * {@inheritDoc}
985      */
986     @Override
987     public IoBuffer expand(int expectedRemaining) {
988         buf.expand(expectedRemaining);
989         return this;
990     }
991 
992     /**
993      * {@inheritDoc}
994      */
995     @Override
996     public Object getObject() throws ClassNotFoundException {
997         return buf.getObject();
998     }
999 
1000     /**
1001      * {@inheritDoc}
1002      */
1003     @Override
1004     public Object getObject(ClassLoader classLoader) throws ClassNotFoundException {
1005         return buf.getObject(classLoader);
1006     }
1007 
1008     /**
1009      * {@inheritDoc}
1010      */
1011     @Override
1012     public IoBuffer putObject(Object o) {
1013         buf.putObject(o);
1014         return this;
1015     }
1016 
1017     /**
1018      * {@inheritDoc}
1019      */
1020     @Override
1021     public InputStream asInputStream() {
1022         return buf.asInputStream();
1023     }
1024 
1025     /**
1026      * {@inheritDoc}
1027      */
1028     @Override
1029     public OutputStream asOutputStream() {
1030         return buf.asOutputStream();
1031     }
1032 
1033     /**
1034      * {@inheritDoc}
1035      */
1036     @Override
1037     public IoBuffer duplicate() {
1038         return buf.duplicate();
1039     }
1040 
1041     /**
1042      * {@inheritDoc}
1043      */
1044     @Override
1045     public IoBuffer slice() {
1046         return buf.slice();
1047     }
1048 
1049     /**
1050      * {@inheritDoc}
1051      */
1052     @Override
1053     public IoBuffer asReadOnlyBuffer() {
1054         return buf.asReadOnlyBuffer();
1055     }
1056 
1057     /**
1058      * {@inheritDoc}
1059      */
1060     @Override
1061     public byte[] array() {
1062         return buf.array();
1063     }
1064 
1065     /**
1066      * {@inheritDoc}
1067      */
1068     @Override
1069     public int arrayOffset() {
1070         return buf.arrayOffset();
1071     }
1072 
1073     /**
1074      * {@inheritDoc}
1075      */
1076     @Override
1077     public int minimumCapacity() {
1078         return buf.minimumCapacity();
1079     }
1080 
1081     /**
1082      * {@inheritDoc}
1083      */
1084     @Override
1085     public IoBuffer minimumCapacity(int minimumCapacity) {
1086         buf.minimumCapacity(minimumCapacity);
1087         return this;
1088     }
1089 
1090     /**
1091      * {@inheritDoc}
1092      */
1093     @Override
1094     public IoBuffer capacity(int newCapacity) {
1095         buf.capacity(newCapacity);
1096         return this;
1097     }
1098 
1099     /**
1100      * {@inheritDoc}
1101      */
1102     @Override
1103     public boolean isReadOnly() {
1104         return buf.isReadOnly();
1105     }
1106 
1107     /**
1108      * {@inheritDoc}
1109      */
1110     @Override
1111     public int markValue() {
1112         return buf.markValue();
1113     }
1114 
1115     /**
1116      * {@inheritDoc}
1117      */
1118     @Override
1119     public boolean hasArray() {
1120         return buf.hasArray();
1121     }
1122 
1123     /**
1124      * {@inheritDoc}
1125      */
1126     @Override
1127     public void free() {
1128         buf.free();
1129     }
1130 
1131     /**
1132      * {@inheritDoc}
1133      */
1134     @Override
1135     public boolean isDerived() {
1136         return buf.isDerived();
1137     }
1138 
1139     /**
1140      * {@inheritDoc}
1141      */
1142     @Override
1143     public boolean isAutoShrink() {
1144         return buf.isAutoShrink();
1145     }
1146 
1147     /**
1148      * {@inheritDoc}
1149      */
1150     @Override
1151     public IoBuffer setAutoShrink(boolean autoShrink) {
1152         buf.setAutoShrink(autoShrink);
1153         return this;
1154     }
1155 
1156     /**
1157      * {@inheritDoc}
1158      */
1159     @Override
1160     public IoBuffer shrink() {
1161         buf.shrink();
1162         return this;
1163     }
1164 
1165     /**
1166      * {@inheritDoc}
1167      */
1168     @Override
1169     public int getMediumInt() {
1170         return buf.getMediumInt();
1171     }
1172 
1173     /**
1174      * {@inheritDoc}
1175      */
1176     @Override
1177     public int getUnsignedMediumInt() {
1178         return buf.getUnsignedMediumInt();
1179     }
1180 
1181     /**
1182      * {@inheritDoc}
1183      */
1184     @Override
1185     public int getMediumInt(int index) {
1186         return buf.getMediumInt(index);
1187     }
1188 
1189     /**
1190      * {@inheritDoc}
1191      */
1192     @Override
1193     public int getUnsignedMediumInt(int index) {
1194         return buf.getUnsignedMediumInt(index);
1195     }
1196 
1197     /**
1198      * {@inheritDoc}
1199      */
1200     @Override
1201     public IoBuffer putMediumInt(int value) {
1202         buf.putMediumInt(value);
1203         return this;
1204     }
1205 
1206     /**
1207      * {@inheritDoc}
1208      */
1209     @Override
1210     public IoBuffer putMediumInt(int index, int value) {
1211         buf.putMediumInt(index, value);
1212         return this;
1213     }
1214 
1215     /**
1216      * {@inheritDoc}
1217      */
1218     @Override
1219     public String getHexDump(int lengthLimit) {
1220         return buf.getHexDump(lengthLimit);
1221     }
1222 
1223     /**
1224      * {@inheritDoc}
1225      */
1226     @Override
1227     public boolean prefixedDataAvailable(int prefixLength) {
1228         return buf.prefixedDataAvailable(prefixLength);
1229     }
1230 
1231     /**
1232      * {@inheritDoc}
1233      */
1234     @Override
1235     public boolean prefixedDataAvailable(int prefixLength, int maxDataLength) {
1236         return buf.prefixedDataAvailable(prefixLength, maxDataLength);
1237     }
1238 
1239     /**
1240      * {@inheritDoc}
1241      */
1242     @Override
1243     public int indexOf(byte b) {
1244         return buf.indexOf(b);
1245     }
1246 
1247     /**
1248      * {@inheritDoc}
1249      */
1250     @Override
1251     public <E extends Enum<E>> E getEnum(Class<E> enumClass) {
1252         return buf.getEnum(enumClass);
1253     }
1254 
1255     /**
1256      * {@inheritDoc}
1257      */
1258     @Override
1259     public <E extends Enum<E>> E getEnum(int index, Class<E> enumClass) {
1260         return buf.getEnum(index, enumClass);
1261     }
1262 
1263     /**
1264      * {@inheritDoc}
1265      */
1266     @Override
1267     public <E extends Enum<E>> E getEnumShort(Class<E> enumClass) {
1268         return buf.getEnumShort(enumClass);
1269     }
1270 
1271     /**
1272      * {@inheritDoc}
1273      */
1274     @Override
1275     public <E extends Enum<E>> E getEnumShort(int index, Class<E> enumClass) {
1276         return buf.getEnumShort(index, enumClass);
1277     }
1278 
1279     /**
1280      * {@inheritDoc}
1281      */
1282     @Override
1283     public <E extends Enum<E>> E getEnumInt(Class<E> enumClass) {
1284         return buf.getEnumInt(enumClass);
1285     }
1286 
1287     /**
1288      * {@inheritDoc}
1289      */
1290     @Override
1291     public <E extends Enum<E>> E getEnumInt(int index, Class<E> enumClass) {
1292         return buf.getEnumInt(index, enumClass);
1293     }
1294 
1295     /**
1296      * {@inheritDoc}
1297      */
1298     @Override
1299     public IoBuffer putEnum(Enum<?> e) {
1300         buf.putEnum(e);
1301         return this;
1302     }
1303 
1304     /**
1305      * {@inheritDoc}
1306      */
1307     @Override
1308     public IoBuffer putEnum(int index, Enum<?> e) {
1309         buf.putEnum(index, e);
1310         return this;
1311     }
1312 
1313     /**
1314      * {@inheritDoc}
1315      */
1316     @Override
1317     public IoBuffer putEnumShort(Enum<?> e) {
1318         buf.putEnumShort(e);
1319         return this;
1320     }
1321 
1322     @Override
1323     public IoBuffer putEnumShort(int index, Enum<?> e) {
1324         buf.putEnumShort(index, e);
1325         return this;
1326     }
1327 
1328     /**
1329      * {@inheritDoc}
1330      */
1331     @Override
1332     public IoBuffer putEnumInt(Enum<?> e) {
1333         buf.putEnumInt(e);
1334         return this;
1335     }
1336 
1337     /**
1338      * {@inheritDoc}
1339      */
1340     @Override
1341     public IoBuffer putEnumInt(int index, Enum<?> e) {
1342         buf.putEnumInt(index, e);
1343         return this;
1344     }
1345 
1346     /**
1347      * {@inheritDoc}
1348      */
1349     @Override
1350     public <E extends Enum<E>> Set<E> getEnumSet(Class<E> enumClass) {
1351         return buf.getEnumSet(enumClass);
1352     }
1353 
1354     /**
1355      * {@inheritDoc}
1356      */
1357     @Override
1358     public <E extends Enum<E>> Set<E> getEnumSet(int index, Class<E> enumClass) {
1359         return buf.getEnumSet(index, enumClass);
1360     }
1361 
1362     /**
1363      * {@inheritDoc}
1364      */
1365     @Override
1366     public <E extends Enum<E>> Set<E> getEnumSetShort(Class<E> enumClass) {
1367         return buf.getEnumSetShort(enumClass);
1368     }
1369 
1370     /**
1371      * {@inheritDoc}
1372      */
1373     @Override
1374     public <E extends Enum<E>> Set<E> getEnumSetShort(int index, Class<E> enumClass) {
1375         return buf.getEnumSetShort(index, enumClass);
1376     }
1377 
1378     /**
1379      * {@inheritDoc}
1380      */
1381     @Override
1382     public <E extends Enum<E>> Set<E> getEnumSetInt(Class<E> enumClass) {
1383         return buf.getEnumSetInt(enumClass);
1384     }
1385 
1386     /**
1387      * {@inheritDoc}
1388      */
1389     @Override
1390     public <E extends Enum<E>> Set<E> getEnumSetInt(int index, Class<E> enumClass) {
1391         return buf.getEnumSetInt(index, enumClass);
1392     }
1393 
1394     /**
1395      * {@inheritDoc}
1396      */
1397     @Override
1398     public <E extends Enum<E>> Set<E> getEnumSetLong(Class<E> enumClass) {
1399         return buf.getEnumSetLong(enumClass);
1400     }
1401 
1402     /**
1403      * {@inheritDoc}
1404      */
1405     @Override
1406     public <E extends Enum<E>> Set<E> getEnumSetLong(int index, Class<E> enumClass) {
1407         return buf.getEnumSetLong(index, enumClass);
1408     }
1409 
1410     /**
1411      * {@inheritDoc}
1412      */
1413     @Override
1414     public <E extends Enum<E>> IoBuffer putEnumSet(Set<E> set) {
1415         buf.putEnumSet(set);
1416         return this;
1417     }
1418 
1419     /**
1420      * {@inheritDoc}
1421      */
1422     @Override
1423     public <E extends Enum<E>> IoBuffer putEnumSet(int index, Set<E> set) {
1424         buf.putEnumSet(index, set);
1425         return this;
1426     }
1427 
1428     /**
1429      * {@inheritDoc}
1430      */
1431     @Override
1432     public <E extends Enum<E>> IoBuffer putEnumSetShort(Set<E> set) {
1433         buf.putEnumSetShort(set);
1434         return this;
1435     }
1436 
1437     /**
1438      * {@inheritDoc}
1439      */
1440     @Override
1441     public <E extends Enum<E>> IoBuffer putEnumSetShort(int index, Set<E> set) {
1442         buf.putEnumSetShort(index, set);
1443         return this;
1444     }
1445 
1446     /**
1447      * {@inheritDoc}
1448      */
1449     @Override
1450     public <E extends Enum<E>> IoBuffer putEnumSetInt(Set<E> set) {
1451         buf.putEnumSetInt(set);
1452         return this;
1453     }
1454 
1455     /**
1456      * {@inheritDoc}
1457      */
1458     @Override
1459     public <E extends Enum<E>> IoBuffer putEnumSetInt(int index, Set<E> set) {
1460         buf.putEnumSetInt(index, set);
1461         return this;
1462     }
1463 
1464     /**
1465      * {@inheritDoc}
1466      */
1467     @Override
1468     public <E extends Enum<E>> IoBuffer putEnumSetLong(Set<E> set) {
1469         buf.putEnumSetLong(set);
1470         return this;
1471     }
1472 
1473     /**
1474      * {@inheritDoc}
1475      */
1476     @Override
1477     public <E extends Enum<E>> IoBuffer putEnumSetLong(int index, Set<E> set) {
1478         buf.putEnumSetLong(index, set);
1479         return this;
1480     }
1481 
1482     /**
1483      * {@inheritDoc}
1484      */
1485     @Override
1486     public IoBuffer putUnsigned(byte value) {
1487         buf.putUnsigned(value);
1488         return this;
1489     }
1490 
1491     /**
1492      * {@inheritDoc}
1493      */
1494     @Override
1495     public IoBuffer putUnsigned(int index, byte value) {
1496         buf.putUnsigned(index, value);
1497         return this;
1498     }
1499 
1500     /**
1501      * {@inheritDoc}
1502      */
1503     @Override
1504     public IoBuffer putUnsigned(short value) {
1505         buf.putUnsigned(value);
1506         return this;
1507     }
1508 
1509     /**
1510      * {@inheritDoc}
1511      */
1512     @Override
1513     public IoBuffer putUnsigned(int index, short value) {
1514         buf.putUnsigned(index, value);
1515         return this;
1516     }
1517 
1518     /**
1519      * {@inheritDoc}
1520      */
1521     @Override
1522     public IoBuffer putUnsigned(int value) {
1523         buf.putUnsigned(value);
1524         return this;
1525     }
1526 
1527     /**
1528      * {@inheritDoc}
1529      */
1530     @Override
1531     public IoBuffer putUnsigned(int index, int value) {
1532         buf.putUnsigned(index, value);
1533         return this;
1534     }
1535 
1536     /**
1537      * {@inheritDoc}
1538      */
1539     @Override
1540     public IoBuffer putUnsigned(long value) {
1541         buf.putUnsigned(value);
1542         return this;
1543     }
1544 
1545     /**
1546      * {@inheritDoc}
1547      */
1548     @Override
1549     public IoBuffer putUnsigned(int index, long value) {
1550         buf.putUnsigned(index, value);
1551         return this;
1552     }
1553 }