@Override
    public void channelRead(ChannelHandlerContext handlerContext, Object object) throws Exception {
        ByteBuf byteBuf = ((ByteBuf) object);
        Channel channel = handlerContext.channel();

        try {
            switch (this.currentProtocol) {
                case HANDSHAKE:
                    handleHandshake(channel, byteBuf);
                    break;
                case LOGIN:
                    handleLogin(channel, byteBuf);
                    break;
                case STATUS:
                    handleStatus(channel, byteBuf);
                    break;
            }
        } finally {
            if (byteBuf.refCnt() > 0)
                byteBuf.release(); // If we don't do this, netty will whine about leaks
        }
    }