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.FilterOutputStream;
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.EnumSet;
37  import java.util.Set;
38  
39  /**
40   * A {@link IoBuffer} that wraps a buffer and proxies any operations to it.
41   * <p>
42   * You can think this class like a {@link FilterOutputStream}.  All operations
43   * are proxied by default so that you can extend this class and override existing
44   * operations selectively.  You can introduce new operations, too.
45   *
46   * @author <a href="http://mina.apache.org">Apache MINA Project</a>
47   */
48  public class IoBufferWrapper extends IoBuffer {
49  
50      /**
51       * The buffer proxied by this proxy.
52       */
53      private final IoBuffer buf;
54  
55      /**
56       * Create a new instance.
57       * @param buf the buffer to be proxied
58       */
59      protected IoBufferWrapper(IoBuffer buf) {
60          if (buf == null) {
61              throw new IllegalArgumentException("buf");
62          }
63          this.buf = buf;
64      }
65  
66      /**
67       * Returns the parent buffer that this buffer wrapped.
68       */
69      public IoBuffer getParentBuffer() {
70          return buf;
71      }
72  
73      @Override
74      public boolean isDirect() {
75          return buf.isDirect();
76      }
77  
78      @Override
79      public ByteBuffer buf() {
80          return buf.buf();
81      }
82  
83      @Override
84      public int capacity() {
85          return buf.capacity();
86      }
87  
88      @Override
89      public int position() {
90          return buf.position();
91      }
92  
93      @Override
94      public IoBuffer position(int newPosition) {
95          buf.position(newPosition);
96          return this;
97      }
98  
99      @Override
100     public int limit() {
101         return buf.limit();
102     }
103 
104     @Override
105     public IoBuffer limit(int newLimit) {
106         buf.limit(newLimit);
107         return this;
108     }
109 
110     @Override
111     public IoBuffer mark() {
112         buf.mark();
113         return this;
114     }
115 
116     @Override
117     public IoBuffer reset() {
118         buf.reset();
119         return this;
120     }
121 
122     @Override
123     public IoBuffer clear() {
124         buf.clear();
125         return this;
126     }
127 
128     @Override
129     public IoBuffer sweep() {
130         buf.sweep();
131         return this;
132     }
133 
134     @Override
135     public IoBuffer sweep(byte value) {
136         buf.sweep(value);
137         return this;
138     }
139 
140     @Override
141     public IoBuffer flip() {
142         buf.flip();
143         return this;
144     }
145 
146     @Override
147     public IoBuffer rewind() {
148         buf.rewind();
149         return this;
150     }
151 
152     @Override
153     public int remaining() {
154         return buf.remaining();
155     }
156 
157     @Override
158     public boolean hasRemaining() {
159         return buf.hasRemaining();
160     }
161 
162     @Override
163     public byte get() {
164         return buf.get();
165     }
166 
167     @Override
168     public short getUnsigned() {
169         return buf.getUnsigned();
170     }
171 
172     @Override
173     public IoBuffer put(byte b) {
174         buf.put(b);
175         return this;
176     }
177 
178     @Override
179     public byte get(int index) {
180         return buf.get(index);
181     }
182 
183     @Override
184     public short getUnsigned(int index) {
185         return buf.getUnsigned(index);
186     }
187 
188     @Override
189     public IoBuffer put(int index, byte b) {
190         buf.put(index, b);
191         return this;
192     }
193 
194     @Override
195     public IoBuffer get(byte[] dst, int offset, int length) {
196         buf.get(dst, offset, length);
197         return this;
198     }
199 
200     @Override
201     public IoBuffer getSlice(int index, int length) {
202         return buf.getSlice(index, length);
203     }
204 
205     @Override
206     public IoBuffer getSlice(int length) {
207         return buf.getSlice(length);
208     }
209 
210     @Override
211     public IoBuffer get(byte[] dst) {
212         buf.get(dst);
213         return this;
214     }
215 
216     @Override
217     public IoBuffer put(IoBuffer src) {
218         buf.put(src);
219         return this;
220     }
221 
222     @Override
223     public IoBuffer put(ByteBuffer src) {
224         buf.put(src);
225         return this;
226     }
227 
228     @Override
229     public IoBuffer put(byte[] src, int offset, int length) {
230         buf.put(src, offset, length);
231         return this;
232     }
233 
234     @Override
235     public IoBuffer put(byte[] src) {
236         buf.put(src);
237         return this;
238     }
239 
240     @Override
241     public IoBuffer compact() {
242         buf.compact();
243         return this;
244     }
245 
246     @Override
247     public String toString() {
248         return buf.toString();
249     }
250 
251     @Override
252     public int hashCode() {
253         return buf.hashCode();
254     }
255 
256     @Override
257     public boolean equals(Object ob) {
258         return buf.equals(ob);
259     }
260 
261     public int compareTo(IoBuffer that) {
262         return buf.compareTo(that);
263     }
264 
265     @Override
266     public ByteOrder order() {
267         return buf.order();
268     }
269 
270     @Override
271     public IoBuffer order(ByteOrder bo) {
272         buf.order(bo);
273         return this;
274     }
275 
276     @Override
277     public char getChar() {
278         return buf.getChar();
279     }
280 
281     @Override
282     public IoBuffer putChar(char value) {
283         buf.putChar(value);
284         return this;
285     }
286 
287     @Override
288     public char getChar(int index) {
289         return buf.getChar(index);
290     }
291 
292     @Override
293     public IoBuffer putChar(int index, char value) {
294         buf.putChar(index, value);
295         return this;
296     }
297 
298     @Override
299     public CharBuffer asCharBuffer() {
300         return buf.asCharBuffer();
301     }
302 
303     @Override
304     public short getShort() {
305         return buf.getShort();
306     }
307 
308     @Override
309     public int getUnsignedShort() {
310         return buf.getUnsignedShort();
311     }
312 
313     @Override
314     public IoBuffer putShort(short value) {
315         buf.putShort(value);
316         return this;
317     }
318 
319     @Override
320     public short getShort(int index) {
321         return buf.getShort(index);
322     }
323 
324     @Override
325     public int getUnsignedShort(int index) {
326         return buf.getUnsignedShort(index);
327     }
328 
329     @Override
330     public IoBuffer putShort(int index, short value) {
331         buf.putShort(index, value);
332         return this;
333     }
334 
335     @Override
336     public ShortBuffer asShortBuffer() {
337         return buf.asShortBuffer();
338     }
339 
340     @Override
341     public int getInt() {
342         return buf.getInt();
343     }
344 
345     @Override
346     public long getUnsignedInt() {
347         return buf.getUnsignedInt();
348     }
349 
350     @Override
351     public IoBuffer putInt(int value) {
352         buf.putInt(value);
353         return this;
354     }
355 
356     @Override
357     public IoBuffer putUnsignedInt(byte value) {
358         buf.putUnsignedInt(value);
359         return this;
360     }
361 
362     @Override
363     public IoBuffer putUnsignedInt(int index, byte value) {
364         buf.putUnsignedInt(index, value);
365         return this;
366     }
367 
368     @Override
369     public IoBuffer putUnsignedInt(short value) {
370         buf.putUnsignedInt(value);
371         return this;
372     }
373 
374     @Override
375     public IoBuffer putUnsignedInt(int index, short value) {
376         buf.putUnsignedInt(index, value);
377         return this;
378     }
379 
380     @Override
381     public IoBuffer putUnsignedInt(int value) {
382         buf.putUnsignedInt(value);
383         return this;
384     }
385 
386     @Override
387     public IoBuffer putUnsignedInt(int index, int value) {
388         buf.putUnsignedInt(index, value);
389         return this;
390     }
391 
392     @Override
393     public IoBuffer putUnsignedInt(long value) {
394         buf.putUnsignedInt(value);
395         return this;
396     }
397 
398     @Override
399     public IoBuffer putUnsignedInt(int index, long value) {
400         buf.putUnsignedInt(index, value);
401         return this;
402     }
403 
404     @Override
405     public IoBuffer putUnsignedShort(byte value) {
406         buf.putUnsignedShort(value);
407         return this;
408     }
409 
410     @Override
411     public IoBuffer putUnsignedShort(int index, byte value) {
412         buf.putUnsignedShort(index, value);
413         return this;
414     }
415 
416     @Override
417     public IoBuffer putUnsignedShort(short value) {
418         buf.putUnsignedShort(value);
419         return this;
420     }
421 
422     @Override
423     public IoBuffer putUnsignedShort(int index, short value) {
424         buf.putUnsignedShort(index, value);
425         return this;
426     }
427 
428     @Override
429     public IoBuffer putUnsignedShort(int value) {
430         buf.putUnsignedShort(value);
431         return this;
432     }
433 
434     @Override
435     public IoBuffer putUnsignedShort(int index, int value) {
436         buf.putUnsignedShort(index, value);
437         return this;
438     }
439 
440     @Override
441     public IoBuffer putUnsignedShort(long value) {
442         buf.putUnsignedShort(value);
443         return this;
444     }
445 
446     @Override
447     public IoBuffer putUnsignedShort(int index, long value) {
448         buf.putUnsignedShort(index, value);
449         return this;
450     }
451 
452     @Override
453     public int getInt(int index) {
454         return buf.getInt(index);
455     }
456 
457     @Override
458     public long getUnsignedInt(int index) {
459         return buf.getUnsignedInt(index);
460     }
461 
462     @Override
463     public IoBuffer putInt(int index, int value) {
464         buf.putInt(index, value);
465         return this;
466     }
467 
468     @Override
469     public IntBuffer asIntBuffer() {
470         return buf.asIntBuffer();
471     }
472 
473     @Override
474     public long getLong() {
475         return buf.getLong();
476     }
477 
478     @Override
479     public IoBuffer putLong(long value) {
480         buf.putLong(value);
481         return this;
482     }
483 
484     @Override
485     public long getLong(int index) {
486         return buf.getLong(index);
487     }
488 
489     @Override
490     public IoBuffer putLong(int index, long value) {
491         buf.putLong(index, value);
492         return this;
493     }
494 
495     @Override
496     public LongBuffer asLongBuffer() {
497         return buf.asLongBuffer();
498     }
499 
500     @Override
501     public float getFloat() {
502         return buf.getFloat();
503     }
504 
505     @Override
506     public IoBuffer putFloat(float value) {
507         buf.putFloat(value);
508         return this;
509     }
510 
511     @Override
512     public float getFloat(int index) {
513         return buf.getFloat(index);
514     }
515 
516     @Override
517     public IoBuffer putFloat(int index, float value) {
518         buf.putFloat(index, value);
519         return this;
520     }
521 
522     @Override
523     public FloatBuffer asFloatBuffer() {
524         return buf.asFloatBuffer();
525     }
526 
527     @Override
528     public double getDouble() {
529         return buf.getDouble();
530     }
531 
532     @Override
533     public IoBuffer putDouble(double value) {
534         buf.putDouble(value);
535         return this;
536     }
537 
538     @Override
539     public double getDouble(int index) {
540         return buf.getDouble(index);
541     }
542 
543     @Override
544     public IoBuffer putDouble(int index, double value) {
545         buf.putDouble(index, value);
546         return this;
547     }
548 
549     @Override
550     public DoubleBuffer asDoubleBuffer() {
551         return buf.asDoubleBuffer();
552     }
553 
554     @Override
555     public String getHexDump() {
556         return buf.getHexDump();
557     }
558 
559     @Override
560     public String getString(int fieldSize, CharsetDecoder decoder) throws CharacterCodingException {
561         return buf.getString(fieldSize, decoder);
562     }
563 
564     @Override
565     public String getString(CharsetDecoder decoder) throws CharacterCodingException {
566         return buf.getString(decoder);
567     }
568 
569     @Override
570     public String getPrefixedString(CharsetDecoder decoder) throws CharacterCodingException {
571         return buf.getPrefixedString(decoder);
572     }
573 
574     @Override
575     public String getPrefixedString(int prefixLength, CharsetDecoder decoder) throws CharacterCodingException {
576         return buf.getPrefixedString(prefixLength, decoder);
577     }
578 
579     @Override
580     public IoBuffer putString(CharSequence in, int fieldSize, CharsetEncoder encoder) throws CharacterCodingException {
581         buf.putString(in, fieldSize, encoder);
582         return this;
583     }
584 
585     @Override
586     public IoBuffer putString(CharSequence in, CharsetEncoder encoder) throws CharacterCodingException {
587         buf.putString(in, encoder);
588         return this;
589     }
590 
591     @Override
592     public IoBuffer putPrefixedString(CharSequence in, CharsetEncoder encoder) throws CharacterCodingException {
593         buf.putPrefixedString(in, encoder);
594         return this;
595     }
596 
597     @Override
598     public IoBuffer putPrefixedString(CharSequence in, int prefixLength, CharsetEncoder encoder)
599             throws CharacterCodingException {
600         buf.putPrefixedString(in, prefixLength, encoder);
601         return this;
602     }
603 
604     @Override
605     public IoBuffer putPrefixedString(CharSequence in, int prefixLength, int padding, CharsetEncoder encoder)
606             throws CharacterCodingException {
607         buf.putPrefixedString(in, prefixLength, padding, encoder);
608         return this;
609     }
610 
611     @Override
612     public IoBuffer putPrefixedString(CharSequence in, int prefixLength, int padding, byte padValue,
613             CharsetEncoder encoder) throws CharacterCodingException {
614         buf.putPrefixedString(in, prefixLength, padding, padValue, encoder);
615         return this;
616     }
617 
618     @Override
619     public IoBuffer skip(int size) {
620         buf.skip(size);
621         return this;
622     }
623 
624     @Override
625     public IoBuffer fill(byte value, int size) {
626         buf.fill(value, size);
627         return this;
628     }
629 
630     @Override
631     public IoBuffer fillAndReset(byte value, int size) {
632         buf.fillAndReset(value, size);
633         return this;
634     }
635 
636     @Override
637     public IoBuffer fill(int size) {
638         buf.fill(size);
639         return this;
640     }
641 
642     @Override
643     public IoBuffer fillAndReset(int size) {
644         buf.fillAndReset(size);
645         return this;
646     }
647 
648     @Override
649     public boolean isAutoExpand() {
650         return buf.isAutoExpand();
651     }
652 
653     @Override
654     public IoBuffer setAutoExpand(boolean autoExpand) {
655         buf.setAutoExpand(autoExpand);
656         return this;
657     }
658 
659     @Override
660     public IoBuffer expand(int pos, int expectedRemaining) {
661         buf.expand(pos, expectedRemaining);
662         return this;
663     }
664 
665     @Override
666     public IoBuffer expand(int expectedRemaining) {
667         buf.expand(expectedRemaining);
668         return this;
669     }
670 
671     @Override
672     public Object getObject() throws ClassNotFoundException {
673         return buf.getObject();
674     }
675 
676     @Override
677     public Object getObject(ClassLoader classLoader) throws ClassNotFoundException {
678         return buf.getObject(classLoader);
679     }
680 
681     @Override
682     public IoBuffer putObject(Object o) {
683         buf.putObject(o);
684         return this;
685     }
686 
687     @Override
688     public InputStream asInputStream() {
689         return buf.asInputStream();
690     }
691 
692     @Override
693     public OutputStream asOutputStream() {
694         return buf.asOutputStream();
695     }
696 
697     @Override
698     public IoBuffer duplicate() {
699         return buf.duplicate();
700     }
701 
702     @Override
703     public IoBuffer slice() {
704         return buf.slice();
705     }
706 
707     @Override
708     public IoBuffer asReadOnlyBuffer() {
709         return buf.asReadOnlyBuffer();
710     }
711 
712     @Override
713     public byte[] array() {
714         return buf.array();
715     }
716 
717     @Override
718     public int arrayOffset() {
719         return buf.arrayOffset();
720     }
721 
722     @Override
723     public int minimumCapacity() {
724         return buf.minimumCapacity();
725     }
726 
727     @Override
728     public IoBuffer minimumCapacity(int minimumCapacity) {
729         buf.minimumCapacity(minimumCapacity);
730         return this;
731     }
732 
733     @Override
734     public IoBuffer capacity(int newCapacity) {
735         buf.capacity(newCapacity);
736         return this;
737     }
738 
739     @Override
740     public boolean isReadOnly() {
741         return buf.isReadOnly();
742     }
743 
744     @Override
745     public int markValue() {
746         return buf.markValue();
747     }
748 
749     @Override
750     public boolean hasArray() {
751         return buf.hasArray();
752     }
753 
754     @Override
755     public void free() {
756         buf.free();
757     }
758 
759     @Override
760     public boolean isDerived() {
761         return buf.isDerived();
762     }
763 
764     @Override
765     public boolean isAutoShrink() {
766         return buf.isAutoShrink();
767     }
768 
769     @Override
770     public IoBuffer setAutoShrink(boolean autoShrink) {
771         buf.setAutoShrink(autoShrink);
772         return this;
773     }
774 
775     @Override
776     public IoBuffer shrink() {
777         buf.shrink();
778         return this;
779     }
780 
781     @Override
782     public int getMediumInt() {
783         return buf.getMediumInt();
784     }
785 
786     @Override
787     public int getUnsignedMediumInt() {
788         return buf.getUnsignedMediumInt();
789     }
790 
791     @Override
792     public int getMediumInt(int index) {
793         return buf.getMediumInt(index);
794     }
795 
796     @Override
797     public int getUnsignedMediumInt(int index) {
798         return buf.getUnsignedMediumInt(index);
799     }
800 
801     @Override
802     public IoBuffer putMediumInt(int value) {
803         buf.putMediumInt(value);
804         return this;
805     }
806 
807     @Override
808     public IoBuffer putMediumInt(int index, int value) {
809         buf.putMediumInt(index, value);
810         return this;
811     }
812 
813     @Override
814     public String getHexDump(int lengthLimit) {
815         return buf.getHexDump(lengthLimit);
816     }
817 
818     @Override
819     public boolean prefixedDataAvailable(int prefixLength) {
820         return buf.prefixedDataAvailable(prefixLength);
821     }
822 
823     @Override
824     public boolean prefixedDataAvailable(int prefixLength, int maxDataLength) {
825         return buf.prefixedDataAvailable(prefixLength, maxDataLength);
826     }
827 
828     @Override
829     public int indexOf(byte b) {
830         return buf.indexOf(b);
831     }
832 
833     @Override
834     public <E extends Enum<E>> E getEnum(Class<E> enumClass) {
835         return buf.getEnum(enumClass);
836     }
837 
838     @Override
839     public <E extends Enum<E>> E getEnum(int index, Class<E> enumClass) {
840         return buf.getEnum(index, enumClass);
841     }
842 
843     @Override
844     public <E extends Enum<E>> E getEnumShort(Class<E> enumClass) {
845         return buf.getEnumShort(enumClass);
846     }
847 
848     @Override
849     public <E extends Enum<E>> E getEnumShort(int index, Class<E> enumClass) {
850         return buf.getEnumShort(index, enumClass);
851     }
852 
853     @Override
854     public <E extends Enum<E>> E getEnumInt(Class<E> enumClass) {
855         return buf.getEnumInt(enumClass);
856     }
857 
858     @Override
859     public <E extends Enum<E>> E getEnumInt(int index, Class<E> enumClass) {
860         return buf.getEnumInt(index, enumClass);
861     }
862 
863     @Override
864     public IoBuffer putEnum(Enum<?> e) {
865         buf.putEnum(e);
866         return this;
867     }
868 
869     @Override
870     public IoBuffer putEnum(int index, Enum<?> e) {
871         buf.putEnum(index, e);
872         return this;
873     }
874 
875     @Override
876     public IoBuffer putEnumShort(Enum<?> e) {
877         buf.putEnumShort(e);
878         return this;
879     }
880 
881     @Override
882     public IoBuffer putEnumShort(int index, Enum<?> e) {
883         buf.putEnumShort(index, e);
884         return this;
885     }
886 
887     @Override
888     public IoBuffer putEnumInt(Enum<?> e) {
889         buf.putEnumInt(e);
890         return this;
891     }
892 
893     @Override
894     public IoBuffer putEnumInt(int index, Enum<?> e) {
895         buf.putEnumInt(index, e);
896         return this;
897     }
898 
899     @Override
900     public <E extends Enum<E>> EnumSet<E> getEnumSet(Class<E> enumClass) {
901         return buf.getEnumSet(enumClass);
902     }
903 
904     @Override
905     public <E extends Enum<E>> EnumSet<E> getEnumSet(int index, Class<E> enumClass) {
906         return buf.getEnumSet(index, enumClass);
907     }
908 
909     @Override
910     public <E extends Enum<E>> EnumSet<E> getEnumSetShort(Class<E> enumClass) {
911         return buf.getEnumSetShort(enumClass);
912     }
913 
914     @Override
915     public <E extends Enum<E>> EnumSet<E> getEnumSetShort(int index, Class<E> enumClass) {
916         return buf.getEnumSetShort(index, enumClass);
917     }
918 
919     @Override
920     public <E extends Enum<E>> EnumSet<E> getEnumSetInt(Class<E> enumClass) {
921         return buf.getEnumSetInt(enumClass);
922     }
923 
924     @Override
925     public <E extends Enum<E>> EnumSet<E> getEnumSetInt(int index, Class<E> enumClass) {
926         return buf.getEnumSetInt(index, enumClass);
927     }
928 
929     @Override
930     public <E extends Enum<E>> EnumSet<E> getEnumSetLong(Class<E> enumClass) {
931         return buf.getEnumSetLong(enumClass);
932     }
933 
934     @Override
935     public <E extends Enum<E>> EnumSet<E> getEnumSetLong(int index, Class<E> enumClass) {
936         return buf.getEnumSetLong(index, enumClass);
937     }
938 
939     @Override
940     public <E extends Enum<E>> IoBuffer putEnumSet(Set<E> set) {
941         buf.putEnumSet(set);
942         return this;
943     }
944 
945     @Override
946     public <E extends Enum<E>> IoBuffer putEnumSet(int index, Set<E> set) {
947         buf.putEnumSet(index, set);
948         return this;
949     }
950 
951     @Override
952     public <E extends Enum<E>> IoBuffer putEnumSetShort(Set<E> set) {
953         buf.putEnumSetShort(set);
954         return this;
955     }
956 
957     @Override
958     public <E extends Enum<E>> IoBuffer putEnumSetShort(int index, Set<E> set) {
959         buf.putEnumSetShort(index, set);
960         return this;
961     }
962 
963     @Override
964     public <E extends Enum<E>> IoBuffer putEnumSetInt(Set<E> set) {
965         buf.putEnumSetInt(set);
966         return this;
967     }
968 
969     @Override
970     public <E extends Enum<E>> IoBuffer putEnumSetInt(int index, Set<E> set) {
971         buf.putEnumSetInt(index, set);
972         return this;
973     }
974 
975     @Override
976     public <E extends Enum<E>> IoBuffer putEnumSetLong(Set<E> set) {
977         buf.putEnumSetLong(set);
978         return this;
979     }
980 
981     @Override
982     public <E extends Enum<E>> IoBuffer putEnumSetLong(int index, Set<E> set) {
983         buf.putEnumSetLong(index, set);
984         return this;
985     }
986 
987     @Override
988     public IoBuffer putUnsigned(byte value) {
989         buf.putUnsigned(value);
990         return this;
991     }
992 
993     @Override
994     public IoBuffer putUnsigned(int index, byte value) {
995         buf.putUnsigned(index, value);
996         return this;
997     }
998 
999     @Override
1000     public IoBuffer putUnsigned(short value) {
1001         buf.putUnsigned(value);
1002         return this;
1003     }
1004 
1005     @Override
1006     public IoBuffer putUnsigned(int index, short value) {
1007         buf.putUnsigned(index, value);
1008         return this;
1009     }
1010 
1011     @Override
1012     public IoBuffer putUnsigned(int value) {
1013         buf.putUnsigned(value);
1014         return this;
1015     }
1016 
1017     @Override
1018     public IoBuffer putUnsigned(int index, int value) {
1019         buf.putUnsigned(index, value);
1020         return this;
1021     }
1022 
1023     @Override
1024     public IoBuffer putUnsigned(long value) {
1025         buf.putUnsigned(value);
1026         return this;
1027     }
1028 
1029     @Override
1030     public IoBuffer putUnsigned(int index, long value) {
1031         buf.putUnsigned(index, value);
1032         return this;
1033     }
1034 }