E1ED922C1E9526DD63272D7EC5C6CB77
2021-02-07 2ad84337e1ae42b56a7b8e463bca9ac06e457826
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
package com.qq.weixin.mp.aes;
 
import java.util.ArrayList;
 
class ByteGroup {
    ArrayList<Byte> byteContainer = new ArrayList<Byte>();
 
    public byte[] toBytes() {
        byte[] bytes = new byte[byteContainer.size()];
        for (int i = 0; i < byteContainer.size(); i++) {
            bytes[i] = byteContainer.get(i);
        }
        return bytes;
    }
 
    public ByteGroup addBytes(byte[] bytes) {
        for (byte b : bytes) {
            byteContainer.add(b);
        }
        return this;
    }
 
    public int size() {
        return byteContainer.size();
    }
}