Guest User

Untitled

a guest
Aug 8th, 2019
178
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 27.64 KB | None | 0 0
  1. package utils;
  2.  
  3. import io.netty.buffer.ByteBuf;
  4. import io.netty.buffer.ByteBufAllocator;
  5. import io.netty.handler.codec.DecoderException;
  6. import io.netty.handler.codec.EncoderException;
  7. import io.netty.util.ByteProcessor;
  8. import java.io.IOException;
  9. import java.io.InputStream;
  10. import java.io.OutputStream;
  11. import java.nio.ByteBuffer;
  12. import java.nio.ByteOrder;
  13. import java.nio.channels.FileChannel;
  14. import java.nio.channels.GatheringByteChannel;
  15. import java.nio.channels.ScatteringByteChannel;
  16. import java.nio.charset.Charset;
  17. import java.nio.charset.StandardCharsets;
  18. import java.util.Date;
  19. import java.util.UUID;
  20.  
  21. public class PacketBuffer extends ByteBuf {
  22. private final ByteBuf buf;
  23.  
  24. public PacketBuffer(ByteBuf wrapped) {
  25. this.buf = wrapped;
  26. }
  27.  
  28. public static int getVarIntSize(int input) {
  29. for (int i = 1; i < 5; ++i) {
  30. if ((input & -1 << i * 7) == 0) {
  31. return i;
  32. }
  33. }
  34.  
  35. return 5;
  36. }
  37.  
  38. public PacketBuffer writeByteArray(byte[] array) {
  39. this.writeVarInt(array.length);
  40. this.writeBytes(array);
  41. return this;
  42. }
  43.  
  44. public byte[] readByteArray() {
  45. return this.readByteArray(this.readableBytes());
  46. }
  47.  
  48. public byte[] readByteArray(int maxLength) {
  49. int i = this.readVarInt();
  50.  
  51. if (i > maxLength) {
  52. throw new DecoderException("ByteArray with size " + i + " is bigger than allowed " + maxLength);
  53. } else {
  54. byte[] abyte = new byte[i];
  55. this.readBytes(abyte);
  56. return abyte;
  57. }
  58. }
  59.  
  60. public PacketBuffer writeVarIntArray(int[] array) {
  61. this.writeVarInt(array.length);
  62.  
  63. for (int i : array) {
  64. this.writeVarInt(i);
  65. }
  66.  
  67. return this;
  68. }
  69.  
  70. public int[] readVarIntArray() {
  71. return this.readVarIntArray(this.readableBytes());
  72. }
  73.  
  74. public int[] readVarIntArray(int maxLength) {
  75. int i = this.readVarInt();
  76.  
  77. if (i > maxLength) {
  78. throw new DecoderException("VarIntArray with size " + i + " is bigger than allowed " + maxLength);
  79. } else {
  80. int[] aint = new int[i];
  81.  
  82. for (int j = 0; j < aint.length; ++j) {
  83. aint[j] = this.readVarInt();
  84. }
  85.  
  86. return aint;
  87. }
  88. }
  89.  
  90. public PacketBuffer writeLongArray(long[] array) {
  91. this.writeVarInt(array.length);
  92.  
  93. for (long i : array) {
  94. this.writeLong(i);
  95. }
  96.  
  97. return this;
  98. }
  99.  
  100. @SuppressWarnings("unchecked")
  101. public <T extends Enum<T>> T readEnumValue(Class<T> enumClass) {
  102. return (T) ((Enum[]) enumClass.getEnumConstants())[this.readVarInt()];
  103. }
  104.  
  105. public PacketBuffer writeEnumValue(Enum<?> value) {
  106. return this.writeVarInt(value.ordinal());
  107. }
  108.  
  109. public int readVarInt() {
  110. int i = 0;
  111. int j = 0;
  112.  
  113. while (true) {
  114. byte b0 = this.readByte();
  115. i |= (b0 & 127) << j++ * 7;
  116.  
  117. if (j > 5) {
  118. throw new RuntimeException("VarInt too big");
  119. }
  120.  
  121. if ((b0 & 128) != 128) {
  122. break;
  123. }
  124. }
  125.  
  126. return i;
  127. }
  128.  
  129. public long readVarLong() {
  130. long i = 0L;
  131. int j = 0;
  132.  
  133. while (true) {
  134. byte b0 = this.readByte();
  135. i |= (long) (b0 & 127) << j++ * 7;
  136.  
  137. if (j > 10) {
  138. throw new RuntimeException("VarLong too big");
  139. }
  140.  
  141. if ((b0 & 128) != 128) {
  142. break;
  143. }
  144. }
  145.  
  146. return i;
  147. }
  148.  
  149. public PacketBuffer writeUniqueId(UUID uuid) {
  150. this.writeLong(uuid.getMostSignificantBits());
  151. this.writeLong(uuid.getLeastSignificantBits());
  152. return this;
  153. }
  154.  
  155. public UUID readUniqueId() {
  156. return new UUID(this.readLong(), this.readLong());
  157. }
  158.  
  159. public PacketBuffer writeVarInt(int input) {
  160. while ((input & -128) != 0) {
  161. this.writeByte(input & 127 | 128);
  162. input >>>= 7;
  163. }
  164.  
  165. this.writeByte(input);
  166. return this;
  167. }
  168.  
  169. public PacketBuffer writeVarLong(long value) {
  170. while ((value & -128L) != 0L) {
  171. this.writeByte((int) (value & 127L) | 128);
  172. value >>>= 7;
  173. }
  174.  
  175. this.writeByte((int) value);
  176. return this;
  177. }
  178.  
  179. public String readString(int maxLength) {
  180. int i = this.readVarInt();
  181.  
  182. if (i > maxLength * 4) {
  183. throw new DecoderException("The received encoded string buffer length is longer than maximum allowed (" + i
  184. + " > " + maxLength * 4 + ")");
  185. } else if (i < 0) {
  186. throw new DecoderException("The received encoded string buffer length is less than zero! Weird string!");
  187. } else {
  188. String s = this.toString(this.readerIndex(), i, StandardCharsets.UTF_8);
  189. this.readerIndex(this.readerIndex() + i);
  190.  
  191. if (s.length() > maxLength) {
  192. throw new DecoderException(
  193. "The received string length is longer than maximum allowed (" + i + " > " + maxLength + ")");
  194. } else {
  195. return s;
  196. }
  197. }
  198. }
  199.  
  200. public PacketBuffer writeString(String string) {
  201. byte[] abyte = string.getBytes(StandardCharsets.UTF_8);
  202.  
  203. if (abyte.length > 32767) {
  204. throw new EncoderException("String too big (was " + abyte.length + " bytes encoded, max " + 32767 + ")");
  205. } else {
  206. this.writeVarInt(abyte.length);
  207. this.writeBytes(abyte);
  208. return this;
  209. }
  210. }
  211.  
  212. public Date readTime() {
  213. return new Date(this.readLong());
  214. }
  215.  
  216. public PacketBuffer writeTime(Date time) {
  217. this.writeLong(time.getTime());
  218. return this;
  219. }
  220.  
  221. @Override
  222. public int capacity() {
  223. return this.buf.capacity();
  224. }
  225.  
  226. @Override
  227. public ByteBuf capacity(int p_capacity_1_) {
  228. return this.buf.capacity(p_capacity_1_);
  229. }
  230.  
  231. @Override
  232. public int maxCapacity() {
  233. return this.buf.maxCapacity();
  234. }
  235.  
  236. @Override
  237. public ByteBufAllocator alloc() {
  238. return this.buf.alloc();
  239. }
  240.  
  241. @Override
  242. @SuppressWarnings("deprecation")
  243. public ByteOrder order() {
  244. return this.buf.order();
  245. }
  246.  
  247. @Override
  248. @SuppressWarnings("deprecation")
  249. public ByteBuf order(ByteOrder p_order_1_) {
  250. return this.buf.order(p_order_1_);
  251. }
  252.  
  253. @Override
  254. public ByteBuf unwrap() {
  255. return this.buf.unwrap();
  256. }
  257.  
  258. @Override
  259. public boolean isDirect() {
  260. return this.buf.isDirect();
  261. }
  262.  
  263. @Override
  264. public boolean isReadOnly() {
  265. return this.buf.isReadOnly();
  266. }
  267.  
  268. @Override
  269. public ByteBuf asReadOnly() {
  270. return this.buf.asReadOnly();
  271. }
  272.  
  273. @Override
  274. public int readerIndex() {
  275. return this.buf.readerIndex();
  276. }
  277.  
  278. @Override
  279. public ByteBuf readerIndex(int p_readerIndex_1_) {
  280. return this.buf.readerIndex(p_readerIndex_1_);
  281. }
  282.  
  283. @Override
  284. public int writerIndex() {
  285. return this.buf.writerIndex();
  286. }
  287.  
  288. @Override
  289. public ByteBuf writerIndex(int p_writerIndex_1_) {
  290. return this.buf.writerIndex(p_writerIndex_1_);
  291. }
  292.  
  293. @Override
  294. public ByteBuf setIndex(int p_setIndex_1_, int p_setIndex_2_) {
  295. return this.buf.setIndex(p_setIndex_1_, p_setIndex_2_);
  296. }
  297.  
  298. @Override
  299. public int readableBytes() {
  300. return this.buf.readableBytes();
  301. }
  302.  
  303. @Override
  304. public int writableBytes() {
  305. return this.buf.writableBytes();
  306. }
  307.  
  308. @Override
  309. public int maxWritableBytes() {
  310. return this.buf.maxWritableBytes();
  311. }
  312.  
  313. @Override
  314. public boolean isReadable() {
  315. return this.buf.isReadable();
  316. }
  317.  
  318. @Override
  319. public boolean isReadable(int p_isReadable_1_) {
  320. return this.buf.isReadable(p_isReadable_1_);
  321. }
  322.  
  323. @Override
  324. public boolean isWritable() {
  325. return this.buf.isWritable();
  326. }
  327.  
  328. @Override
  329. public boolean isWritable(int p_isWritable_1_) {
  330. return this.buf.isWritable(p_isWritable_1_);
  331. }
  332.  
  333. @Override
  334. public ByteBuf clear() {
  335. return this.buf.clear();
  336. }
  337.  
  338. @Override
  339. public ByteBuf markReaderIndex() {
  340. return this.buf.markReaderIndex();
  341. }
  342.  
  343. @Override
  344. public ByteBuf resetReaderIndex() {
  345. return this.buf.resetReaderIndex();
  346. }
  347.  
  348. @Override
  349. public ByteBuf markWriterIndex() {
  350. return this.buf.markWriterIndex();
  351. }
  352.  
  353. @Override
  354. public ByteBuf resetWriterIndex() {
  355. return this.buf.resetWriterIndex();
  356. }
  357.  
  358. @Override
  359. public ByteBuf discardReadBytes() {
  360. return this.buf.discardReadBytes();
  361. }
  362.  
  363. @Override
  364. public ByteBuf discardSomeReadBytes() {
  365. return this.buf.discardSomeReadBytes();
  366. }
  367.  
  368. @Override
  369. public ByteBuf ensureWritable(int p_ensureWritable_1_) {
  370. return this.buf.ensureWritable(p_ensureWritable_1_);
  371. }
  372.  
  373. @Override
  374. public int ensureWritable(int p_ensureWritable_1_, boolean p_ensureWritable_2_) {
  375. return this.buf.ensureWritable(p_ensureWritable_1_, p_ensureWritable_2_);
  376. }
  377.  
  378. @Override
  379. public boolean getBoolean(int p_getBoolean_1_) {
  380. return this.buf.getBoolean(p_getBoolean_1_);
  381. }
  382.  
  383. @Override
  384. public byte getByte(int p_getByte_1_) {
  385. return this.buf.getByte(p_getByte_1_);
  386. }
  387.  
  388. @Override
  389. public short getUnsignedByte(int p_getUnsignedByte_1_) {
  390. return this.buf.getUnsignedByte(p_getUnsignedByte_1_);
  391. }
  392.  
  393. @Override
  394. public short getShort(int p_getShort_1_) {
  395. return this.buf.getShort(p_getShort_1_);
  396. }
  397.  
  398. @Override
  399. public short getShortLE(int p_getShortLE_1_) {
  400. return this.buf.getShortLE(p_getShortLE_1_);
  401. }
  402.  
  403. @Override
  404. public int getUnsignedShort(int p_getUnsignedShort_1_) {
  405. return this.buf.getUnsignedShort(p_getUnsignedShort_1_);
  406. }
  407.  
  408. @Override
  409. public int getUnsignedShortLE(int p_getUnsignedShortLE_1_) {
  410. return this.buf.getUnsignedShortLE(p_getUnsignedShortLE_1_);
  411. }
  412.  
  413. @Override
  414. public int getMedium(int p_getMedium_1_) {
  415. return this.buf.getMedium(p_getMedium_1_);
  416. }
  417.  
  418. @Override
  419. public int getMediumLE(int p_getMediumLE_1_) {
  420. return this.buf.getMediumLE(p_getMediumLE_1_);
  421. }
  422.  
  423. @Override
  424. public int getUnsignedMedium(int p_getUnsignedMedium_1_) {
  425. return this.buf.getUnsignedMedium(p_getUnsignedMedium_1_);
  426. }
  427.  
  428. @Override
  429. public int getUnsignedMediumLE(int p_getUnsignedMediumLE_1_) {
  430. return this.buf.getUnsignedMediumLE(p_getUnsignedMediumLE_1_);
  431. }
  432.  
  433. @Override
  434. public int getInt(int p_getInt_1_) {
  435. return this.buf.getInt(p_getInt_1_);
  436. }
  437.  
  438. @Override
  439. public int getIntLE(int p_getIntLE_1_) {
  440. return this.buf.getIntLE(p_getIntLE_1_);
  441. }
  442.  
  443. @Override
  444. public long getUnsignedInt(int p_getUnsignedInt_1_) {
  445. return this.buf.getUnsignedInt(p_getUnsignedInt_1_);
  446. }
  447.  
  448. @Override
  449. public long getUnsignedIntLE(int p_getUnsignedIntLE_1_) {
  450. return this.buf.getUnsignedIntLE(p_getUnsignedIntLE_1_);
  451. }
  452.  
  453. @Override
  454. public long getLong(int p_getLong_1_) {
  455. return this.buf.getLong(p_getLong_1_);
  456. }
  457.  
  458. @Override
  459. public long getLongLE(int p_getLongLE_1_) {
  460. return this.buf.getLongLE(p_getLongLE_1_);
  461. }
  462.  
  463. @Override
  464. public char getChar(int p_getChar_1_) {
  465. return this.buf.getChar(p_getChar_1_);
  466. }
  467.  
  468. @Override
  469. public float getFloat(int p_getFloat_1_) {
  470. return this.buf.getFloat(p_getFloat_1_);
  471. }
  472.  
  473. @Override
  474. public double getDouble(int p_getDouble_1_) {
  475. return this.buf.getDouble(p_getDouble_1_);
  476. }
  477.  
  478. @Override
  479. public ByteBuf getBytes(int p_getBytes_1_, ByteBuf p_getBytes_2_) {
  480. return this.buf.getBytes(p_getBytes_1_, p_getBytes_2_);
  481. }
  482.  
  483. @Override
  484. public ByteBuf getBytes(int p_getBytes_1_, ByteBuf p_getBytes_2_, int p_getBytes_3_) {
  485. return this.buf.getBytes(p_getBytes_1_, p_getBytes_2_, p_getBytes_3_);
  486. }
  487.  
  488. @Override
  489. public ByteBuf getBytes(int p_getBytes_1_, ByteBuf p_getBytes_2_, int p_getBytes_3_, int p_getBytes_4_) {
  490. return this.buf.getBytes(p_getBytes_1_, p_getBytes_2_, p_getBytes_3_, p_getBytes_4_);
  491. }
  492.  
  493. @Override
  494. public ByteBuf getBytes(int p_getBytes_1_, byte[] p_getBytes_2_) {
  495. return this.buf.getBytes(p_getBytes_1_, p_getBytes_2_);
  496. }
  497.  
  498. @Override
  499. public ByteBuf getBytes(int p_getBytes_1_, byte[] p_getBytes_2_, int p_getBytes_3_, int p_getBytes_4_) {
  500. return this.buf.getBytes(p_getBytes_1_, p_getBytes_2_, p_getBytes_3_, p_getBytes_4_);
  501. }
  502.  
  503. @Override
  504. public ByteBuf getBytes(int p_getBytes_1_, ByteBuffer p_getBytes_2_) {
  505. return this.buf.getBytes(p_getBytes_1_, p_getBytes_2_);
  506. }
  507.  
  508. @Override
  509. public ByteBuf getBytes(int p_getBytes_1_, OutputStream p_getBytes_2_, int p_getBytes_3_) throws IOException {
  510. return this.buf.getBytes(p_getBytes_1_, p_getBytes_2_, p_getBytes_3_);
  511. }
  512.  
  513. @Override
  514. public int getBytes(int p_getBytes_1_, GatheringByteChannel p_getBytes_2_, int p_getBytes_3_) throws IOException {
  515. return this.buf.getBytes(p_getBytes_1_, p_getBytes_2_, p_getBytes_3_);
  516. }
  517.  
  518. @Override
  519. public int getBytes(int p_getBytes_1_, FileChannel p_getBytes_2_, long p_getBytes_3_, int p_getBytes_5_)
  520. throws IOException {
  521. return this.buf.getBytes(p_getBytes_1_, p_getBytes_2_, p_getBytes_3_, p_getBytes_5_);
  522. }
  523.  
  524. @Override
  525. public CharSequence getCharSequence(int p_getCharSequence_1_, int p_getCharSequence_2_,
  526. Charset p_getCharSequence_3_) {
  527. return this.buf.getCharSequence(p_getCharSequence_1_, p_getCharSequence_2_, p_getCharSequence_3_);
  528. }
  529.  
  530. @Override
  531. public ByteBuf setBoolean(int p_setBoolean_1_, boolean p_setBoolean_2_) {
  532. return this.buf.setBoolean(p_setBoolean_1_, p_setBoolean_2_);
  533. }
  534.  
  535. @Override
  536. public ByteBuf setByte(int p_setByte_1_, int p_setByte_2_) {
  537. return this.buf.setByte(p_setByte_1_, p_setByte_2_);
  538. }
  539.  
  540. @Override
  541. public ByteBuf setShort(int p_setShort_1_, int p_setShort_2_) {
  542. return this.buf.setShort(p_setShort_1_, p_setShort_2_);
  543. }
  544.  
  545. @Override
  546. public ByteBuf setShortLE(int p_setShortLE_1_, int p_setShortLE_2_) {
  547. return this.buf.setShortLE(p_setShortLE_1_, p_setShortLE_2_);
  548. }
  549.  
  550. @Override
  551. public ByteBuf setMedium(int p_setMedium_1_, int p_setMedium_2_) {
  552. return this.buf.setMedium(p_setMedium_1_, p_setMedium_2_);
  553. }
  554.  
  555. @Override
  556. public ByteBuf setMediumLE(int p_setMediumLE_1_, int p_setMediumLE_2_) {
  557. return this.buf.setMediumLE(p_setMediumLE_1_, p_setMediumLE_2_);
  558. }
  559.  
  560. @Override
  561. public ByteBuf setInt(int p_setInt_1_, int p_setInt_2_) {
  562. return this.buf.setInt(p_setInt_1_, p_setInt_2_);
  563. }
  564.  
  565. @Override
  566. public ByteBuf setIntLE(int p_setIntLE_1_, int p_setIntLE_2_) {
  567. return this.buf.setIntLE(p_setIntLE_1_, p_setIntLE_2_);
  568. }
  569.  
  570. @Override
  571. public ByteBuf setLong(int p_setLong_1_, long p_setLong_2_) {
  572. return this.buf.setLong(p_setLong_1_, p_setLong_2_);
  573. }
  574.  
  575. @Override
  576. public ByteBuf setLongLE(int p_setLongLE_1_, long p_setLongLE_2_) {
  577. return this.buf.setLongLE(p_setLongLE_1_, p_setLongLE_2_);
  578. }
  579.  
  580. @Override
  581. public ByteBuf setChar(int p_setChar_1_, int p_setChar_2_) {
  582. return this.buf.setChar(p_setChar_1_, p_setChar_2_);
  583. }
  584.  
  585. @Override
  586. public ByteBuf setFloat(int p_setFloat_1_, float p_setFloat_2_) {
  587. return this.buf.setFloat(p_setFloat_1_, p_setFloat_2_);
  588. }
  589.  
  590. @Override
  591. public ByteBuf setDouble(int p_setDouble_1_, double p_setDouble_2_) {
  592. return this.buf.setDouble(p_setDouble_1_, p_setDouble_2_);
  593. }
  594.  
  595. @Override
  596. public ByteBuf setBytes(int p_setBytes_1_, ByteBuf p_setBytes_2_) {
  597. return this.buf.setBytes(p_setBytes_1_, p_setBytes_2_);
  598. }
  599.  
  600. @Override
  601. public ByteBuf setBytes(int p_setBytes_1_, ByteBuf p_setBytes_2_, int p_setBytes_3_) {
  602. return this.buf.setBytes(p_setBytes_1_, p_setBytes_2_, p_setBytes_3_);
  603. }
  604.  
  605. @Override
  606. public ByteBuf setBytes(int p_setBytes_1_, ByteBuf p_setBytes_2_, int p_setBytes_3_, int p_setBytes_4_) {
  607. return this.buf.setBytes(p_setBytes_1_, p_setBytes_2_, p_setBytes_3_, p_setBytes_4_);
  608. }
  609.  
  610. @Override
  611. public ByteBuf setBytes(int p_setBytes_1_, byte[] p_setBytes_2_) {
  612. return this.buf.setBytes(p_setBytes_1_, p_setBytes_2_);
  613. }
  614.  
  615. @Override
  616. public ByteBuf setBytes(int p_setBytes_1_, byte[] p_setBytes_2_, int p_setBytes_3_, int p_setBytes_4_) {
  617. return this.buf.setBytes(p_setBytes_1_, p_setBytes_2_, p_setBytes_3_, p_setBytes_4_);
  618. }
  619.  
  620. @Override
  621. public ByteBuf setBytes(int p_setBytes_1_, ByteBuffer p_setBytes_2_) {
  622. return this.buf.setBytes(p_setBytes_1_, p_setBytes_2_);
  623. }
  624.  
  625. @Override
  626. public int setBytes(int p_setBytes_1_, InputStream p_setBytes_2_, int p_setBytes_3_) throws IOException {
  627. return this.buf.setBytes(p_setBytes_1_, p_setBytes_2_, p_setBytes_3_);
  628. }
  629.  
  630. @Override
  631. public int setBytes(int p_setBytes_1_, ScatteringByteChannel p_setBytes_2_, int p_setBytes_3_) throws IOException {
  632. return this.buf.setBytes(p_setBytes_1_, p_setBytes_2_, p_setBytes_3_);
  633. }
  634.  
  635. @Override
  636. public int setBytes(int p_setBytes_1_, FileChannel p_setBytes_2_, long p_setBytes_3_, int p_setBytes_5_)
  637. throws IOException {
  638. return this.buf.setBytes(p_setBytes_1_, p_setBytes_2_, p_setBytes_3_, p_setBytes_5_);
  639. }
  640.  
  641. @Override
  642. public ByteBuf setZero(int p_setZero_1_, int p_setZero_2_) {
  643. return this.buf.setZero(p_setZero_1_, p_setZero_2_);
  644. }
  645.  
  646. @Override
  647. public int setCharSequence(int p_setCharSequence_1_, CharSequence p_setCharSequence_2_,
  648. Charset p_setCharSequence_3_) {
  649. return this.buf.setCharSequence(p_setCharSequence_1_, p_setCharSequence_2_, p_setCharSequence_3_);
  650. }
  651.  
  652. @Override
  653. public boolean readBoolean() {
  654. return this.buf.readBoolean();
  655. }
  656.  
  657. @Override
  658. public byte readByte() {
  659. return this.buf.readByte();
  660. }
  661.  
  662. @Override
  663. public short readUnsignedByte() {
  664. return this.buf.readUnsignedByte();
  665. }
  666.  
  667. @Override
  668. public short readShort() {
  669. return this.buf.readShort();
  670. }
  671.  
  672. @Override
  673. public short readShortLE() {
  674. return this.buf.readShortLE();
  675. }
  676.  
  677. @Override
  678. public int readUnsignedShort() {
  679. return this.buf.readUnsignedShort();
  680. }
  681.  
  682. @Override
  683. public int readUnsignedShortLE() {
  684. return this.buf.readUnsignedShortLE();
  685. }
  686.  
  687. @Override
  688. public int readMedium() {
  689. return this.buf.readMedium();
  690. }
  691.  
  692. @Override
  693. public int readMediumLE() {
  694. return this.buf.readMediumLE();
  695. }
  696.  
  697. @Override
  698. public int readUnsignedMedium() {
  699. return this.buf.readUnsignedMedium();
  700. }
  701.  
  702. @Override
  703. public int readUnsignedMediumLE() {
  704. return this.buf.readUnsignedMediumLE();
  705. }
  706.  
  707. @Override
  708. public int readInt() {
  709. return this.buf.readInt();
  710. }
  711.  
  712. @Override
  713. public int readIntLE() {
  714. return this.buf.readIntLE();
  715. }
  716.  
  717. @Override
  718. public long readUnsignedInt() {
  719. return this.buf.readUnsignedInt();
  720. }
  721.  
  722. @Override
  723. public long readUnsignedIntLE() {
  724. return this.buf.readUnsignedIntLE();
  725. }
  726.  
  727. @Override
  728. public long readLong() {
  729. return this.buf.readLong();
  730. }
  731.  
  732. @Override
  733. public long readLongLE() {
  734. return this.buf.readLongLE();
  735. }
  736.  
  737. @Override
  738. public char readChar() {
  739. return this.buf.readChar();
  740. }
  741.  
  742. @Override
  743. public float readFloat() {
  744. return this.buf.readFloat();
  745. }
  746.  
  747. @Override
  748. public double readDouble() {
  749. return this.buf.readDouble();
  750. }
  751.  
  752. @Override
  753. public ByteBuf readBytes(int p_readBytes_1_) {
  754. return this.buf.readBytes(p_readBytes_1_);
  755. }
  756.  
  757. @Override
  758. public ByteBuf readSlice(int p_readSlice_1_) {
  759. return this.buf.readSlice(p_readSlice_1_);
  760. }
  761.  
  762. @Override
  763. public ByteBuf readRetainedSlice(int p_readRetainedSlice_1_) {
  764. return this.buf.readRetainedSlice(p_readRetainedSlice_1_);
  765. }
  766.  
  767. @Override
  768. public ByteBuf readBytes(ByteBuf p_readBytes_1_) {
  769. return this.buf.readBytes(p_readBytes_1_);
  770. }
  771.  
  772. @Override
  773. public ByteBuf readBytes(ByteBuf p_readBytes_1_, int p_readBytes_2_) {
  774. return this.buf.readBytes(p_readBytes_1_, p_readBytes_2_);
  775. }
  776.  
  777. @Override
  778. public ByteBuf readBytes(ByteBuf p_readBytes_1_, int p_readBytes_2_, int p_readBytes_3_) {
  779. return this.buf.readBytes(p_readBytes_1_, p_readBytes_2_, p_readBytes_3_);
  780. }
  781.  
  782. @Override
  783. public ByteBuf readBytes(byte[] p_readBytes_1_) {
  784. return this.buf.readBytes(p_readBytes_1_);
  785. }
  786.  
  787. @Override
  788. public ByteBuf readBytes(byte[] p_readBytes_1_, int p_readBytes_2_, int p_readBytes_3_) {
  789. return this.buf.readBytes(p_readBytes_1_, p_readBytes_2_, p_readBytes_3_);
  790. }
  791.  
  792. @Override
  793. public ByteBuf readBytes(ByteBuffer p_readBytes_1_) {
  794. return this.buf.readBytes(p_readBytes_1_);
  795. }
  796.  
  797. @Override
  798. public ByteBuf readBytes(OutputStream p_readBytes_1_, int p_readBytes_2_) throws IOException {
  799. return this.buf.readBytes(p_readBytes_1_, p_readBytes_2_);
  800. }
  801.  
  802. @Override
  803. public int readBytes(GatheringByteChannel p_readBytes_1_, int p_readBytes_2_) throws IOException {
  804. return this.buf.readBytes(p_readBytes_1_, p_readBytes_2_);
  805. }
  806.  
  807. @Override
  808. public CharSequence readCharSequence(int p_readCharSequence_1_, Charset p_readCharSequence_2_) {
  809. return this.buf.readCharSequence(p_readCharSequence_1_, p_readCharSequence_2_);
  810. }
  811.  
  812. @Override
  813. public int readBytes(FileChannel p_readBytes_1_, long p_readBytes_2_, int p_readBytes_4_) throws IOException {
  814. return this.buf.readBytes(p_readBytes_1_, p_readBytes_2_, p_readBytes_4_);
  815. }
  816.  
  817. @Override
  818. public ByteBuf skipBytes(int p_skipBytes_1_) {
  819. return this.buf.skipBytes(p_skipBytes_1_);
  820. }
  821.  
  822. @Override
  823. public ByteBuf writeBoolean(boolean p_writeBoolean_1_) {
  824. return this.buf.writeBoolean(p_writeBoolean_1_);
  825. }
  826.  
  827. @Override
  828. public ByteBuf writeByte(int p_writeByte_1_) {
  829. return this.buf.writeByte(p_writeByte_1_);
  830. }
  831.  
  832. @Override
  833. public ByteBuf writeShort(int p_writeShort_1_) {
  834. return this.buf.writeShort(p_writeShort_1_);
  835. }
  836.  
  837. @Override
  838. public ByteBuf writeShortLE(int p_writeShortLE_1_) {
  839. return this.buf.writeShortLE(p_writeShortLE_1_);
  840. }
  841.  
  842. @Override
  843. public ByteBuf writeMedium(int p_writeMedium_1_) {
  844. return this.buf.writeMedium(p_writeMedium_1_);
  845. }
  846.  
  847. @Override
  848. public ByteBuf writeMediumLE(int p_writeMediumLE_1_) {
  849. return this.buf.writeMediumLE(p_writeMediumLE_1_);
  850. }
  851.  
  852. @Override
  853. public ByteBuf writeInt(int p_writeInt_1_) {
  854. return this.buf.writeInt(p_writeInt_1_);
  855. }
  856.  
  857. @Override
  858. public ByteBuf writeIntLE(int p_writeIntLE_1_) {
  859. return this.buf.writeIntLE(p_writeIntLE_1_);
  860. }
  861.  
  862. @Override
  863. public ByteBuf writeLong(long p_writeLong_1_) {
  864. return this.buf.writeLong(p_writeLong_1_);
  865. }
  866.  
  867. @Override
  868. public ByteBuf writeLongLE(long p_writeLongLE_1_) {
  869. return this.buf.writeLongLE(p_writeLongLE_1_);
  870. }
  871.  
  872. @Override
  873. public ByteBuf writeChar(int p_writeChar_1_) {
  874. return this.buf.writeChar(p_writeChar_1_);
  875. }
  876.  
  877. @Override
  878. public ByteBuf writeFloat(float p_writeFloat_1_) {
  879. return this.buf.writeFloat(p_writeFloat_1_);
  880. }
  881.  
  882. @Override
  883. public ByteBuf writeDouble(double p_writeDouble_1_) {
  884. return this.buf.writeDouble(p_writeDouble_1_);
  885. }
  886.  
  887. @Override
  888. public ByteBuf writeBytes(ByteBuf p_writeBytes_1_) {
  889. return this.buf.writeBytes(p_writeBytes_1_);
  890. }
  891.  
  892. @Override
  893. public ByteBuf writeBytes(ByteBuf p_writeBytes_1_, int p_writeBytes_2_) {
  894. return this.buf.writeBytes(p_writeBytes_1_, p_writeBytes_2_);
  895. }
  896.  
  897. @Override
  898. public ByteBuf writeBytes(ByteBuf p_writeBytes_1_, int p_writeBytes_2_, int p_writeBytes_3_) {
  899. return this.buf.writeBytes(p_writeBytes_1_, p_writeBytes_2_, p_writeBytes_3_);
  900. }
  901.  
  902. @Override
  903. public ByteBuf writeBytes(byte[] p_writeBytes_1_) {
  904. return this.buf.writeBytes(p_writeBytes_1_);
  905. }
  906.  
  907. @Override
  908. public ByteBuf writeBytes(byte[] p_writeBytes_1_, int p_writeBytes_2_, int p_writeBytes_3_) {
  909. return this.buf.writeBytes(p_writeBytes_1_, p_writeBytes_2_, p_writeBytes_3_);
  910. }
  911.  
  912. @Override
  913. public ByteBuf writeBytes(ByteBuffer p_writeBytes_1_) {
  914. return this.buf.writeBytes(p_writeBytes_1_);
  915. }
  916.  
  917. @Override
  918. public int writeBytes(InputStream p_writeBytes_1_, int p_writeBytes_2_) throws IOException {
  919. return this.buf.writeBytes(p_writeBytes_1_, p_writeBytes_2_);
  920. }
  921.  
  922. @Override
  923. public int writeBytes(ScatteringByteChannel p_writeBytes_1_, int p_writeBytes_2_) throws IOException {
  924. return this.buf.writeBytes(p_writeBytes_1_, p_writeBytes_2_);
  925. }
  926.  
  927. @Override
  928. public int writeBytes(FileChannel p_writeBytes_1_, long p_writeBytes_2_, int p_writeBytes_4_) throws IOException {
  929. return this.buf.writeBytes(p_writeBytes_1_, p_writeBytes_2_, p_writeBytes_4_);
  930. }
  931.  
  932. @Override
  933. public ByteBuf writeZero(int p_writeZero_1_) {
  934. return this.buf.writeZero(p_writeZero_1_);
  935. }
  936.  
  937. @Override
  938. public int writeCharSequence(CharSequence p_writeCharSequence_1_, Charset p_writeCharSequence_2_) {
  939. return this.buf.writeCharSequence(p_writeCharSequence_1_, p_writeCharSequence_2_);
  940. }
  941.  
  942. @Override
  943. public int indexOf(int p_indexOf_1_, int p_indexOf_2_, byte p_indexOf_3_) {
  944. return this.buf.indexOf(p_indexOf_1_, p_indexOf_2_, p_indexOf_3_);
  945. }
  946.  
  947. @Override
  948. public int bytesBefore(byte p_bytesBefore_1_) {
  949. return this.buf.bytesBefore(p_bytesBefore_1_);
  950. }
  951.  
  952. @Override
  953. public int bytesBefore(int p_bytesBefore_1_, byte p_bytesBefore_2_) {
  954. return this.buf.bytesBefore(p_bytesBefore_1_, p_bytesBefore_2_);
  955. }
  956.  
  957. @Override
  958. public int bytesBefore(int p_bytesBefore_1_, int p_bytesBefore_2_, byte p_bytesBefore_3_) {
  959. return this.buf.bytesBefore(p_bytesBefore_1_, p_bytesBefore_2_, p_bytesBefore_3_);
  960. }
  961.  
  962. @Override
  963. public int forEachByte(ByteProcessor p_forEachByte_1_) {
  964. return this.buf.forEachByte(p_forEachByte_1_);
  965. }
  966.  
  967. @Override
  968. public int forEachByte(int p_forEachByte_1_, int p_forEachByte_2_, ByteProcessor p_forEachByte_3_) {
  969. return this.buf.forEachByte(p_forEachByte_1_, p_forEachByte_2_, p_forEachByte_3_);
  970. }
  971.  
  972. @Override
  973. public int forEachByteDesc(ByteProcessor p_forEachByteDesc_1_) {
  974. return this.buf.forEachByteDesc(p_forEachByteDesc_1_);
  975. }
  976.  
  977. @Override
  978. public int forEachByteDesc(int p_forEachByteDesc_1_, int p_forEachByteDesc_2_, ByteProcessor p_forEachByteDesc_3_) {
  979. return this.buf.forEachByteDesc(p_forEachByteDesc_1_, p_forEachByteDesc_2_, p_forEachByteDesc_3_);
  980. }
  981.  
  982. @Override
  983. public ByteBuf copy() {
  984. return this.buf.copy();
  985. }
  986.  
  987. @Override
  988. public ByteBuf copy(int p_copy_1_, int p_copy_2_) {
  989. return this.buf.copy(p_copy_1_, p_copy_2_);
  990. }
  991.  
  992. @Override
  993. public ByteBuf slice() {
  994. return this.buf.slice();
  995. }
  996.  
  997. @Override
  998. public ByteBuf retainedSlice() {
  999. return this.buf.retainedSlice();
  1000. }
  1001.  
  1002. @Override
  1003. public ByteBuf slice(int p_slice_1_, int p_slice_2_) {
  1004. return this.buf.slice(p_slice_1_, p_slice_2_);
  1005. }
  1006.  
  1007. @Override
  1008. public ByteBuf retainedSlice(int p_retainedSlice_1_, int p_retainedSlice_2_) {
  1009. return this.buf.retainedSlice(p_retainedSlice_1_, p_retainedSlice_2_);
  1010. }
  1011.  
  1012. @Override
  1013. public ByteBuf duplicate() {
  1014. return this.buf.duplicate();
  1015. }
  1016.  
  1017. @Override
  1018. public ByteBuf retainedDuplicate() {
  1019. return this.buf.retainedDuplicate();
  1020. }
  1021.  
  1022. @Override
  1023. public int nioBufferCount() {
  1024. return this.buf.nioBufferCount();
  1025. }
  1026.  
  1027. @Override
  1028. public ByteBuffer nioBuffer() {
  1029. return this.buf.nioBuffer();
  1030. }
  1031.  
  1032. @Override
  1033. public ByteBuffer nioBuffer(int p_nioBuffer_1_, int p_nioBuffer_2_) {
  1034. return this.buf.nioBuffer(p_nioBuffer_1_, p_nioBuffer_2_);
  1035. }
  1036.  
  1037. @Override
  1038. public ByteBuffer internalNioBuffer(int p_internalNioBuffer_1_, int p_internalNioBuffer_2_) {
  1039. return this.buf.internalNioBuffer(p_internalNioBuffer_1_, p_internalNioBuffer_2_);
  1040. }
  1041.  
  1042. @Override
  1043. public ByteBuffer[] nioBuffers() {
  1044. return this.buf.nioBuffers();
  1045. }
  1046.  
  1047. @Override
  1048. public ByteBuffer[] nioBuffers(int p_nioBuffers_1_, int p_nioBuffers_2_) {
  1049. return this.buf.nioBuffers(p_nioBuffers_1_, p_nioBuffers_2_);
  1050. }
  1051.  
  1052. @Override
  1053. public boolean hasArray() {
  1054. return this.buf.hasArray();
  1055. }
  1056.  
  1057. @Override
  1058. public byte[] array() {
  1059. return this.buf.array();
  1060. }
  1061.  
  1062. @Override
  1063. public int arrayOffset() {
  1064. return this.buf.arrayOffset();
  1065. }
  1066.  
  1067. @Override
  1068. public boolean hasMemoryAddress() {
  1069. return this.buf.hasMemoryAddress();
  1070. }
  1071.  
  1072. @Override
  1073. public long memoryAddress() {
  1074. return this.buf.memoryAddress();
  1075. }
  1076.  
  1077. @Override
  1078. public String toString(Charset p_toString_1_) {
  1079. return this.buf.toString(p_toString_1_);
  1080. }
  1081.  
  1082. @Override
  1083. public String toString(int p_toString_1_, int p_toString_2_, Charset p_toString_3_) {
  1084. return this.buf.toString(p_toString_1_, p_toString_2_, p_toString_3_);
  1085. }
  1086.  
  1087. @Override
  1088. public int hashCode() {
  1089. return this.buf.hashCode();
  1090. }
  1091.  
  1092. @Override
  1093. public boolean equals(Object p_equals_1_) {
  1094. return this.buf.equals(p_equals_1_);
  1095. }
  1096.  
  1097. @Override
  1098. public int compareTo(ByteBuf p_compareTo_1_) {
  1099. return this.buf.compareTo(p_compareTo_1_);
  1100. }
  1101.  
  1102. @Override
  1103. public String toString() {
  1104. return this.buf.toString();
  1105. }
  1106.  
  1107. @Override
  1108. public ByteBuf retain(int p_retain_1_) {
  1109. return this.buf.retain(p_retain_1_);
  1110. }
  1111.  
  1112. @Override
  1113. public ByteBuf retain() {
  1114. return this.buf.retain();
  1115. }
  1116.  
  1117. @Override
  1118. public ByteBuf touch() {
  1119. return this.buf.touch();
  1120. }
  1121.  
  1122. @Override
  1123. public ByteBuf touch(Object p_touch_1_) {
  1124. return this.buf.touch(p_touch_1_);
  1125. }
  1126.  
  1127. @Override
  1128. public int refCnt() {
  1129. return this.buf.refCnt();
  1130. }
  1131.  
  1132. @Override
  1133. public boolean release() {
  1134. return this.buf.release();
  1135. }
  1136.  
  1137. @Override
  1138. public boolean release(int p_release_1_) {
  1139. return this.buf.release(p_release_1_);
  1140. }
  1141. }
Advertisement
Add Comment
Please, Sign In to add comment