當我嘗試在groovy中創建一個字節數組數組時,出現錯誤。我的代碼是:無法在groovy中創建一個字節數組數組
def patch0 = [0, 2, 4, 8, 16] as byte[];
def patch1 = [0, 3, 6, 12, 24] as byte[];
def patches = [patch0, patch1] as byte[];
我得到的錯誤是:
GroovyCastException: Cannot cast object '[[email protected]' with class '[B' to class 'java.lang.Number'