Don't throw here. Just do this instead:

    ptr.set(ByteUtil.EMPTY_BYTE_ARRAY);
    return true;