To store data on the blockchain, a storage container bytes[6] data is used, each array stores maximum amount based on block gas limit. Can assembly be used to add those 6 arrays together, and return one single bytes array?
function getData() public view {
uint length;
for(uint i = 0; i<6; i++) {
length += data[i].length;
}
bytes memory result = new bytes(length);
uint index = 32; // bytes is an array, and in EVM the first
// 32 bytes of an array stores the length
// of the array, so add data 32 byte in
for(i = 0; i < 6; i++) {
bytes memory oneSixth = new bytes(data[i].length);
oneSixth = data[i];
assembly {
mstore(add(result, index), add(oneSixth, 32))
}
index += data[i].length;
}
}