public static byte[][] readList(InputStream input, int listWidth, int elemWidth)
            throws SerializationException {
        ArrayList<byte[]> result = new ArrayList<byte[]>();
        byte[] data = readVariableBytes(input, listWidth);
        input = new ByteArrayInputStream(data);
        try {
            while (input.available() > 0) {
                result.add(readVariableBytes(input, elemWidth));
            }
        } catch (IOException e) {
            throw new SerializationException(e);
        }
        return result.toArray(new byte[result.size()][]);
    }
Read a variable length vector of variable sized elements as described by RFC5246 section 4.3.
The vector is prefixed by its total length, in bytes and in big endian format,
so is each element contained in the vector.
@param listWidth the width of the vector's length field, in bytes.
@param elemWidth the width of each element's length field, in bytes.
@throws SerializationException if EOF is encountered.
common/src/main/java/org/conscrypt/ct/Serialization.java