Class MsgUtil

java.lang.Object
alexiil.mc.lib.net.MsgUtil

public final class MsgUtil
extends java.lang.Object
Various utilities for reading and writing data
  • Method Summary

    Modifier and Type Method Description
    static void appendBufferData​(io.netty.buffer.ByteBuf buffer, int length, java.lang.StringBuilder sb, java.lang.String linePrefix, int readerIndex)  
    static void ensureEmpty​(io.netty.buffer.ByteBuf buf, boolean throwError, java.lang.String extra)
    Checks to make sure that this buffer has been *completely* read (so that there are no readable bytes left over
    static void printWholeBuffer​(io.netty.buffer.ByteBuf buf)  
    static java.lang.String readUTF​(NetByteBuf buffer)  
    static void writeUTF​(NetByteBuf buffer, java.lang.String string)  

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • writeUTF

      public static void writeUTF​(NetByteBuf buffer, java.lang.String string)
    • readUTF

      public static java.lang.String readUTF​(NetByteBuf buffer)
    • ensureEmpty

      public static void ensureEmpty​(io.netty.buffer.ByteBuf buf, boolean throwError, java.lang.String extra) throws InvalidInputDataException
      Checks to make sure that this buffer has been *completely* read (so that there are no readable bytes left over
      Throws:
      InvalidInputDataException
    • printWholeBuffer

      public static void printWholeBuffer​(io.netty.buffer.ByteBuf buf)
    • appendBufferData

      public static void appendBufferData​(io.netty.buffer.ByteBuf buffer, int length, java.lang.StringBuilder sb, java.lang.String linePrefix, int readerIndex)